At 2:16 PM +0200 10/3/01, Florent Coste wrote:
>I'm not a kernel guru too,
>
>but what know is that :
>java threads are mapped to posix threads (linuxthreads in the glibc). The
>linuxthreads library uses the kernel threads, which directly map 
>into a 'process
>like' entry in the scheduler. (1-1 mapping). One has already said 
>that the linux
>kernel is optimized for the common case, ie few processus in the 
>scheduler queue.


This isn't exactly accurate.  Threads in linux (including Java 
threads) don't use posix threads, but the low, low level clone() 
system call.  clone()ed processes, by default, share all their memory 
with each other, just like a thread.  fork() builds off of clone() 
and implements copy-on-write between the processes.  But that's not 
part of threading.

clone()ed processes also share all the same file descriptors between 
themselves.  I believe the only thing they do not share is their 
stack, obviously.

That's what I remember from reading some article on it a while back, 
but feel free to correct me if I'm off somewhere.

Avi


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to