On Wed, 30 Oct 2002, Dossy wrote:
>
> Do you have any kind of evidence or benchmarks to support this?
Sorry, no benchmarks. I've read this several places and there is
reasonable thought to back this up. Here is a relevant excerpt from
the comp.programming.threads.faq:
6.2. Performance differences
In terms of context switch time, user-space threads are the
fastest, with two-level threads coming next (all other things
being equal). However, if you have a multiprocessor, user-level
threads can only be run on a single CPU, while both two-level
and pure kernel-supported threads can be run on multiple CPUs
simultaneously.
- http://www.serpentine.com/~bos/threads-faq/#6-2-Performance-differences
As I mentioned, a library threads implemenation CAN be more effecient
-- that is on single CPU machines. Obviously, an implementation that
allows threads to span CPUs will out perform one where all threads are
bound to a single CPU. In fact, 1:1 and possibly 1:n implementation
may be less ineffecient on a machine with one CPU. Of course, context
switch time isn't the only factor in performance.
Sorry if that sounded like, ``user threads on a 16 CPU machine can
easily out perform 1:1 thread implementation on the same machine!''
Once again: I was just trying to say that user threads does not
have to mean poor performance. :^)
-Ayan
>
> At the low end (single CPU, few threads) they're all "pretty much
> the same" but at high-end (4-way or 8-way CPU and >5,000 concurrent
> threads) you can pretty much watch userspace threads suck in a
> visibly measurable way.
>
> I think that's what Yahoo! is talking about with regard to their
> threading issues on FreeBSD. But, as it's been pointed out, Apache 2
> is multithreaded, so ... I bet Yahoo! is just going to continue using,
> supporting and developing Apache 1.3 until FreeBSD thread support
> catches up.
>
> -- Dossy
>