next up previous
Next: The GNU Hurd Up: The GNU Hurd Previous: Monolithic kernels and micro-kernels

Subsections

Technical interlude: RPCs

Inter-Process Communication

An IPC is a way for a user-space program to communicate with another one. In Unix, the most common IPC forms are a pipe and a signal.

Remote Procedure Call

A remote procedure call, or RPC, is a specific set of IPCs, where a client asks a server to perform a task, and then the server acts accordingly, providing an answer in most cases. An HTTP request can be seen as an RPC between a web browser (client) and an httpd (server).

A typical RPC is composed of two IPCs: one from the client to the server, with the type of the request (name of the procedure to call for example) and the parameters of the request; and then another one from the server to the client, indicating the result of request, or at least that the request was perfomed with success or with an error.

To make servers and clients easier to write, most of the programs using a lot of RPCs (CORBA distributed systems, or multi-server operating systems) use stubs. A ``client stub'' is called natively (like a normal C function if the program is in C), and then performs the marshalling (encoding of the parameters according to the protocol used, being IIOP for CORBA or Mach IPC for the GNU Hurd), the actual request, waiting for the result, and then demarshalling it, retuning it again as a native value. A server stub performs similar functions for the server.

Stubs are usually generated by a stub-code generator, like CORBA's ``idl compilers'', Mach's ``MiG'' or L4's ``idl4''. Those stubs are generated from interface files, which look a bit like C .h files: they contain the prototypes of all RPCs, with the datatype of the argument(s) and return value(s). Those interface files are used both by the stub code generator, and as an API reference for the RPCs.


next up previous
Next: The GNU Hurd Up: The GNU Hurd Previous: Monolithic kernels and micro-kernels
Gael Le Mignot 2005-06-08