Hacker News new | ask | show | jobs
by Animats 4305 days ago
Compare QNX message passing, which has a much simpler API and runs faster.

The UNIX/Linux world has never gotten message passing right. It's inevitably built on top of files, sockets, or shared memory, which adds complexity and reduces speed.

4 comments

Ironically, in addition to working on the code described by the linked piece, I also implemented POSIX.1b message queues for QNX. (Namely, for QNX4 in 1995.) While I'm not necessarily in love with .1b message queues (see the commit referred to by my earlier comment, above), one cannot compare blocking message passing (Send/Receive/Reply) to message queueing -- they have entirely different semantics. (The QNX primitives are more analogous to doors.[1]) I would also caution about making blanket statements about performance with respect to different IPC mechanisms on entirely different systems: aside from the lack of quantification in your assertion, different IPC mechanisms often solve slightly different problems, and each must be considered within the context of its own system.

[1] http://en.wikipedia.org/wiki/Doors_(computing)

Using files and sockets as common abstractions for a variety of underlying mechanisms is one of the most powerful things about UNIX/Linux. Yes, there are tradeoffs, but in return, it means you can interoperate with a tremendous number of utilities and tools (which don't even need to know anything about the underlying mechanism) in unplanned and unexpected ways... for free.
Trigger Warning: Memories of reading about Plan 9
As long as you happen to understand what goes thru the pipe, which isn't always the case.
Building message queues on top of shared memory seems like a pretty natural high performance solution. What would you suggest?
FreeBSD pipes, for one, haven't been based on sockets in over ten years.