On Fri, May 27, 2005 at 01:19:06PM +0100, Gustavo Felisberto wrote:
> When i has reading the docs i saw "On Linux x86, threading is
> implemented using clone()" this is refering to "On Linux x86, sbcl is
> using threads using clone()" When i read that i understood that the docs
> said that linux used clone for threads (as in the old pre nptl).
You seem still to be confused. For the record:
- there are two threading libraries for Linux: LinuxThreads (the old one)
and NPTL (the new one)
- They both provide a POSIX Threads ("pthreads") interface, and are both
implemented with use of clone()
- however, they typically use different options to clone(); a LinuxThreads
system will create a separate pid for each thread, whereas a system
with NPTL libraries will share the pid between threads.
- SBCL does not currently[*] use the pthreads interface at all, because when
the threading support was added NPTL was either in early development or
did not yet exist, and LinuxThreads is badly broken. Instead it calls
clone() directly. The options to clone() that it uses cause it to
create a separate pid for each thread
- However, it does require kernel support for futexes (for its mutex
implementation). As not many people knwo whether they've got this,
and as it's available on pretty much exactly the same systems as
NPTL (it is part of the kernel support required for NPTL), we describe
SBCL as needing NPTL
[*] There's a currently-stalled branch of SBCL in CVS which uses the pthread
interfaces, but it's stuck on an interaction between POSIX 1003.1b semaphores
and copying GC, which I cannot see how to resolve in a non-icky way. See
http://ww.telent.net/diary/2005/3/#6.793
|