Xander Solis wrote:

Well.. i think its rather rare that common "user-land" programs would interact
with kernel space threads, unless it would require kernel managed tasks or routines.
>
> In my opinion, native threads would suffice, if programs are only designed for
> small specific tasks or would only constitute forking threads in user-space.

The concern is not really about the interaction between threads running in
userland mode and threads running in privileged mode but rather the
/mapping/ between kernel threads (which does NOT mean a thread running in
privileged mode, but rather, a thread /scheduled/ by the kernel) and the
threads that you 'see' in your programming language.

When you use NPTL, each of your posix threads (aka the threads you 'see' in your
programming language) are mapped onto exactly one kernel thread (i.e. a 1:1 model).
The present LinuxThreads pthreads-compliant implementation in glibc 2.3.2 is also
a 1:1 model, but it is far far less efficient (and thus much less scalable) than
NPTL and, while offering the same pthreads (POSIX threads) API, has compliance
problems that make it hard to port pthreads using programs that run well on other
unices over onto Linux.

The main advantage of mapping your programming language's threads onto kernel
threads is that, in SMP machines, the kernel can schedule those threads to run
on multiple CPUs.  In a single CPU machine, that advantage disappears and you
can always opt to have your own concurrency abstraction/implementations (threads
or otherwise) which ultimately run in the context of a single kernel thread/process
and this particular aspect won't be a real negative.


For reference:

Gnu Pth - M:1 (and not even pre-emptive!)
NGPT - M:N
NPTL, LinuxThreads - 1:1




-- reply to: a n d y @ n e t f x p h . c o m -- Philippine Linux Users' Group (PLUG) Mailing List [EMAIL PROTECTED] (#PLUG @ irc.free.net.ph) Official Website: http://plug.linux.org.ph Searchable Archives: http://marc.free.net.ph . To leave, go to http://lists.q-linux.com/mailman/listinfo/plug . Are you a Linux newbie? To join the newbie list, go to http://lists.q-linux.com/mailman/listinfo/ph-linux-newbie

Reply via email to