lkml.org 
[lkml]   [1999]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Threads in linux.
On Tue, 17 Aug 1999, Peter Liniker wrote:

> Linux does not have kernel-level threads, this is true. There is a
> 'clone()' kernel call which can be used to implement threads in user
> space in a library (e.g. libpthreads with glibc2). This threading is as
> good as the windows threading in my experience.
>
> Reason for this implementation is that Linux context-switches are very
> fast, so it made more sense to keep the context-switching code than
> re-write it as a 2 level process model for processes and threads.

This is exactly the same thing -- context switching time depends on what
is shared, so if you made threads with clone(2), they behave like threads,
and they look like any other threads through library interface (one *has*
to have a library interface to threads). The only difference is how they
are numbered in the system.

"Library-only" implementation of threads means that threads are
implemented in userspace in single process without any explicit support
from scheduler and resources management -- this kind of implementation
doesn't take advantage of SMP and can block process on anything blocking
that happens in any of its thread.

--
Alex


-
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/

\
 
 \ /
  Last update: 2005-03-22 13:53    [W:0.233 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site