Re: Thread implementations...

Albert D. Cahalan (acahalan@cs.uml.edu)
Fri, 19 Jun 1998 02:34:49 -0400 (EDT)


David S. Miller writes:

>> Unix multiplexing facilities -- select and poll -- are wake-all
>> primitives. When something happens, everything waiting is awakened
>> and immediately starts fighting for something to do. What a waste.
>> They make a lot of sense for processes though. On NT completion
>> ports provide wake-one semantics... which are perfect for threads.
>
> Yes, this does in fact suck. However, the path to go down is not
> to expect the way select/poll work to change, rather look at other
> existing facilities or invent new ones which solve this problem.
> Too much user code exists which depends upon the wake-all semantics,
> so the only person to blame is whoever designed the behaviors of
> these unix operations to begin with ;-)

For select(), a negative fd count could be used to indicate
that only one process (one per event?) should be woken.

Flags are OK. If you allow 24 million file descriptors, you can
still get 8 flag bits.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu