What's the thread model on Linux?

Patrick Tullmann kaffe@rufus.w3.org
Tue, 22 May 2001 17:00:39 -0600


>   But what I found is that kaffe cannot even support 200 users.

Interesting!  Only the unix-jthreads code gets tested and used a lot,
so I wouldn't be too surprised that unix-pthreads can't keep up with
unix-jthreads.  In any event, the unix-pthreads code should be able to
support more than 200 threads.  It could very well be a simple problem
in the unix-pthread code.

> Shouldn't kernel thread offer better performance?

Only on an SMP machine.  Kaffe's jthread implementation is very good
about switching internal threads when blocking I/O operations are
performed.  That is traditionally a bottleneck for user-mode threading
implementations.  User-mode threads are much lighter-weight than
kernel threads (no need to enter the kernel for a thread switch, and
no need to use kernel support for critical sections).  However, on an
SMP machine, no user-mode thread package can take advantage of the
multiple CPUs.

-Pat

----- ----- ---- ---  ---  --   -    -      -         -               -
Pat Tullmann                                       tullmann@cs.utah.edu
	      Success means never having to wear a suit.