Re: Linus on Linux, Apache and Threads

Stephen C. Tweedie (sct@redhat.com)
Mon, 26 Apr 1999 22:52:48 +0100 (BST)


Hi,

On Mon, 26 Apr 1999 22:19:31 +0200 (CEST), Ingo Molnar
<mingo@chiara.csoma.elte.hu> said:

> i dont think this is a RL issue, most SysV semaphores (in SAP and Oracle)
> are mutexes.

That's not the point. Many server systems do use a single
demultiplexing process with multiple worker threads.

Right now, they typically use something like pipes to share the work
amongst worker threads. Threads pick the data up in FIFO order when new
work enters the queue. The problem is that every mechanism we have for
this will wake up ALL idle worker threads in the kernel: only one will
actually succeed in grabbing the message, but the others will still
consume kernel-mode CPU time.

The only place I can see where we avoid wake-all is in the SysV
semaphore code. Using a message queue in shared memory plus sysV
semaphores to actually wake up the clients _will_ avoid the thundering
herd effect. So it's a genuine issue to consider whether or not this is
worth it.

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