lkml.org 
[lkml]   [1999]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Linus on Linux, Apache and Threads

Tony Gale wrote:
>
> Can I just get some clarification here. pthread_cond_signal is
> defined as waking *one* thread, thus:
>
> pthread_cond_signal restarts one of the threads that are
> waiting on the condition variable cond. If no threads are
> waiting on cond, nothing happens. If several threads are
> waiting on cond, exactly one is restarted, but it is not
> specified which.
>
> Are you saying that the kernel will in fact wake up *all* the threads
> (either just internally, or in actuality)?

I'm interested in this too. Tony's point was my immediate thought:
pthread_cond_signal is an obvious implementation of a solution to the
'thundering herd' problem. But it has apparently been discounted.

I had assumed that this was because of some limitation to the linux
pthread implementation. I had read (somewhere, recently) that linux
pthreads in a process were not scheduled independently by the kernel,
but were scheduled only within that process, thus only get a single
kernel scheduling slot. This is a real limitation. But Matt Ranney
has said on this list that:

<snip> Linux pthreads are all kernel processes, <snip>

True? I'll go find the answers on my own, but I'm curious about the
answer to Tony Gale's question.

-Richard

--
Richard Dynes
rdynes@varcom.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/

\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.046 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site