11 Mar 2007 slamb   » (Journeyer)

lkcl, re: message passing

First, you're wrong about rename(): it's not atomic. There is an intermediate step that processes can see. From the Linux manpage:

However, when overwriting there will probably be a window in which both oldpath and newpath refer to the file being renamed.

(The atomicity people say it provides is carefully limited...newpath either refers to the old file or the new file. That's generally all you need.)

Second, your statement that Linux lacks message passing and atomic operations is false. Linux has many forms of message passing between processes/threads - pipes/FIFOs/sockets, POSIX message queues, etc, and they are entirely suitable for the task pphaneuf asked about. I'm not sure what atomicity guarantee he'd need that Linux doesn't provide. You call write() to send a byte on a wake-up pipe, and that byte is either in the buffer or it's not. There's no intermediate state; therefore, it is atomic. What more do you want? Block until the other process/ thread has actually grabbed the byte? Why? You can build that if desired.

Third, your mention of microkernels is a nonsequitur. I find Tanenbaum's work, and the L4 project you're alluding to by mentioning those universities, to be quite interesting. However, microkernels are not necessary to provide any particular IPC facility for userspace processes to communicate amongst themselves.

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!