Re: Linus on Linux, Apache and Threads

Matt Ranney (mjr@ranney.com)
27 Apr 1999 11:45:03 -0700


Ingo Molnar <mingo@chiara.csoma.elte.hu> writes:

> > Are you saying that the kernel will in fact wake up *all* the threads
> > (either just internally, or in actuality)?
>
> i think in glibc 2.1 it uses RT queued signals, thus it's a true 1:1
> wakeup. Not sure though.

After trying both, I can state with certainty that using
pthread_cond_broadcast() vs. pthread_cond_signal() results in VERY
different levels of context switching and associated performance
degredation. Of course, this still doesn't prove that there isn't
extra overhead with the waking of just one thread.

As I said to someone in private email on the subject, the overhead of
a thread context switch might indeed be less than that of a process,
but its still quite significant in some applications.

-- 
Matt Ranney - mjr@ranney.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/