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

doctor@fruitbat.org
Wed, 27 Jan 1999 15:54:30 -0800 (PST)


Brandon S. Allbery KF8NH said ...
>
> In message <199901262158.NAA07641@gremlin.fruitbat.org>, doctor@fruitbat.org writes:
> +-----
> | 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).

Which proves my point: These facilities were not ment to be treated as
files. They were designed with a specific need in mind. When I read
posts the likes of Alex and Richard above (no offense, guys) it's like
your saying you don't like the Apple Pie that was baked yesterday. Well,
if you don't like it, go bake a new one! But stop saying the pie of
yesterday is old and moldy and should be thrown away when it tastes just
fine to the rest of us, thank you very much. (um.. sorry for the "pie"
analogy. I'm hungry ;-)

> 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).

Yes, you *could* shoe-horn the mechanism into a file architecture, but
(as was already stated above) it would be awkward and inappropriate to
use. Don't ignore the history of Unix's design. There's a reason for
everything. AIX's select() allowed message queues because AIX already
implemented distributed message queues (back when AIX was only on the
PC/RT). It's just no other OS supported it ;-)

Anyway, back to our pie, um err, "discussion" ;-)

-- 
Peter A. Castro (doctor@fruitbat.org) or (pcastro@us.oracle.com)

- 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/