httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject Re: [Fwd: Pthread library benchmarks]
Date Mon, 14 Dec 1998 04:33:55 GMT


On Sun, 13 Dec 1998, Scott Dybiec wrote:

> You may want to take the high cost of creating and context switching
> with LinuxThreads into consideration when building the threaded version
> of Apache for Linux. PMPthreads is the user-based pthread library used
> for comparison.

The linuxthreads creation cost is high because of lacking functionality in
clone() which essentially requires a context switch into a "master" thread
to create a new thread.  There's a few proposals to fix this. 

Comparing the context switch cost of a pure user threads packages against
a pure kernel threads package is somewhat unfair.  The user threads
package has to simulate all blocking i/o using non-blocking i/o.  For the
kernel solution the "i/o cost" is part of the context switch overhead.  To
provide a more balanced comparison you'd need some benchmark that does
i/o. 

Threads within apache will almost always context switch due to blocking on
i/o... rather than blocking on semaphores or using up a timeslice.  Which
makes it even more interesting to know the effects of i/o on the
pmpthreads package. 

At any rate, given that pmpthreads looks like pthreads to the programmer,
it shouldn't be hard to just link against it instead of linuxthreads... so
I don't think we need to worry much about it.  No? 

Dean


Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message