On Sat, 24 Apr 1999 01:17:14 +0100 (BST), alan@lxorguk.ukuu.org.uk (Alan
Cox) said:
>> Each time an element is put on the event queue, you up the semaphore.
>> Before getting the dequeue lock on the queue, the thread would down the
>> semaphore.
> That isnt the performance issue. The scaling issue tends to be the "wake all
> / wake one" stuff - which is hard to do well for wake one.
SysV semaphores do wake-one for simple up/down counted use. The 2.2.6
implementation does have a couple of problems right now: it will _only_
wake one at a time even if you up() more than once, and it will do so in
strict FIFO, which is not necessarily going to direct the wakeup to the
best thread (ie. the one last scheduled on a CPU which is now idle).
The multiple-wakeup issue can be fixed pretty easily. Selecting the
best next thread if you have multiple waiters, without doing a wake-all,
is harder.
--Stephen
-
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/