Live data from Hacker News

A Posix Queue Implementation

zinascii.com

1–10 of 14 posts

Re: A Posix Queue Implementation

#2
This is a great piece, and it reminds how rare it is to have excellent expository systems writing. It's certainly fitting that Ryan cites the late Richard Stevens, who was the exemplar of such writing. Those who like Stevens and Ryan's piece should also look for work by Elliott Organick: he must be considered the pioneer of expository systems monographs, and while his books are very hard to find (and the systems they describe long-since powered off), they remain rewarding reads.

On a more personal note, it was fun to reminisce about code that I hadn't been in in a long time -- I had actually forgotten how much surgery I did on the message queue code back in 1997[1], and I had the opportunity to chuckle at some of the comments made by my 23-year-old self.[2] I also marveled at how little this software has changed in the nearly two decades since; I've written about this before[3], but it's always inspiring to be reminded that we in software have the luxury of creating useful things that do not wear out -- may we only have more writing like Ryan's to learn about them!

[1] https://github.com/illumos/illumos-gate/blob/a9e987e05eeb8cc...

[2] https://github.com/illumos/illumos-gate/blob/a9e987e05eeb8cc...

[3] http://dtrace.org/blogs/bmc/2004/08/28/the-economics-of-soft...

Re: A Posix Queue Implementation

#4
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.

Re: A Posix Queue Implementation

#5
post #4

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.

FreeBSD pipes, for one, haven't been based on sockets in over ten years.

Re: A Posix Queue Implementation

#6
post #4

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.

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)

Re: A Posix Queue Implementation

#7
post #4

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.

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.

Re: A Posix Queue Implementation

#8
post #4

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.

Building message queues on top of shared memory seems like a pretty natural high performance solution. What would you suggest?

Re: A Posix Queue Implementation

#9
Does anything use posix queues? Lack of support has never been an issue for openbsd afaik. Looks like somebody snuck it into FreeBSD, which I wasn't aware of until I just looked it up. Seems like a forgotten feature.

Re: A Posix Queue Implementation

#10
post #4

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.

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
Post reply on HN