On Wed, Oct 03, 2001 at 06:50:48AM -0700, Avi Cherry wrote: > 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.
"POSIX threads" is an API, not a specification for implementation, and the JVM is using it. The current Linux implementation of POSIX threads uses the clone() kernel call for each thread, resulting in a 1-1 mapping to kernel threads. The work on a new POSIX threads implementation with Solaris-style NxM threads should vastly improve the Linux JVM's scalability. Nathan > > 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] > -- ---------------------------------------------------------------------- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]