Download Text - Barrelfish
Transcript
2. Background 2.1.3 Inter Dispatcher Communication & Flounder In Barrelfish, a dispatcher is a unit of kernel scheduling and is responsible for the management of the kernel’s threads. Communication between different dispatchers (so called Inter Dispatcher Communication or IDC) is performed over bidirectional communication channels. A channel is defined by Flounder, an interface definition language. A Flounder interface is used to describe the messages exchanged over a channel. At compile time the interface is translated into C code, which allows applications to use stubs to send messages. A server can export an interface by sending a message to the monitor. The monitor then assigns a unique interface reference (iref) to the interface. Clients can use this iref to identify the service and initiate a connection. Barrelfish has a name service called Chips. Chips is used to store and look-up irefs based on a name chosen by the server. There are a number of back-ends for message passing in Barrelfish. The one chosen at runtime depends on the underlying hardware and the location of the sender and receiver. For example, on x86 hardware there are two implementations: local message passing (LMP) using hardware registers and user message passing (UMP) using shared memory. Whereas LMP is used for IDC between two dispatchers on the same core, IDC between different cores uses UMP. Which mechanism is used is determined during connection set-up. 2.1.4 Capabilities In order to keep track of global resources, Barrelfish uses capabilities [14] to manage ownership and type of a resource. An area in Barrelfish that uses capabilities is the memory system: In case a program needs access to RAM it can request a capability for a given region of memory. The capability is then used for all calls to the kernel to invoke operations on that memory region. In contrast to access control lists (ACL) it is possible to provide fine-grained access to a specific set of resources for individual user-space programs. User-space programs do not have direct access to capabilities but instead use capability references. This allows them to pass these references around and delegate permissions to others. 2.1.5 THC THC [11] is a set of language constructs for composable asynchronous I/O. THC is integrated in the message passing system in Barrelfish. THC’s benefit is that it avoids "stack-ripped" code: Regular Flounder bindings require to specify callbacks to handle incoming messages. Plus, sending a message can fail if the communication channel is currently busy. This usually forces 4