Re: User vs. Kernel (was: To be smug, or not to be smug, that is ,

Brandon S. Allbery KF8NH (allbery@kf8nh.apk.net)
Tue, 26 Jan 1999 18:01:30 -0500


In message <199901262158.NAA07641@gremlin.fruitbat.org>, doctor@fruitbat.org
wr
ites:
+-----
| Richard Gooch said ...
| > Alan Cox writes:
| > > > In userland, you can't support message queues in select() like AIX can.
| > > Im amazed people stil use them, they are a classic example of retrofitting
| > > somethng un-needed onto unix without the people at the time thinking what
| > > they were doing.
| > Agreed! What the hell is wrong with a pipe/socketpair anyway? It fits
| > right in there in the everything-is-a-file model. Message queues don't.
|
| So? What's wrong with that? Shared memory isn't a file. Semaphores
| aren't files? Neither are message queues and a whole slew of other
| things that aren't files. They all have their uses. Not everthing has
| to be a file. I've done a number of small projects where we used message
+--->8

I suppose it depends on how it's done... but Xenix attached shared memory
(*not* of the mmap() variety) and semaphores into the filesystem (type
S_IFNAM, with the type S_INSHD / S_INSEM encoded in rdev). It was generally
more of an annoyance than anything else, since you couldn't use the ordinary
file calls to access them (open() got EISNAM IIRC).

That said, message queues *do* fit the file model to a considerable extent;
one could use special flags to poll() to implement the full functionality of
System V's msgrcv() and use select() to deal with the most common case
(possibly with an fcntl()/ioctl() to set a desired message type mask).

-- 
brandon s. allbery	[os/2][linux][solaris][japh]	 allbery@kf8nh.apk.net
system administrator	     [WAY too many hats]	   allbery@ece.cmu.edu
carnegie mellon / electrical and computer engineering			 KF8NH
     We are Linux. Resistance is an indication that you missed the point.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/