Originally posted by Michael Ernest:
In Solaris, the answer is no. User-level threads run from a library that looks no different to the kernel than a single-threaded process.
Technically speaking, this is a true statement but only because Solaris supports light-weight processes (LWPs) which
are known to the OS and look very much like what we would generally call a "thread". From a native application (C, C++, etc.) perspective, a
thread may be either bound to an LWP or not. Unbound threads are run, as needed, from a pool of LWPs that do not have a thread bound to them and whose reason for living is to run unbound threads. For more information, see
Mauro, Jim and Richard McDougall. Solaris Internals: Core Kernel Architecture Windows NT/2000/etc. threads are more analogous to Solaris LWPs in that the OS "knows" about them. Windows also supports something called "fibers" which are application-scheduled threads but I've only read about them - I've never used them.
A Linux thread is actually yet another process (each of them have their own pid) that shares address space, etc. with the original thread.
Now, since this
is the Java Ranch, I'm pretty sure the original poster was referring to Java threads. I'm just guessing but I'm pretty sure that this depends on the implementation of the VM that you're running. I think that early versions of the Java VM for Linux implemented their own threading due to a lack of support for threads under really early versions of Linux (forgive me if my recollection is incorrect). I'm pretty sure, however, that the later VMs use native threads so the question of whether the OS knows about your Java threads depends on whether the OS knows about native threads.
I know that, when I run something like Forte for Java under Linux, a "ps -ef" listing shows dozens of threads so I think you can be pretty sure that the OS will know about threads or, in the case of Solaris at least, LWPs.
Ken Savela
kensavela@hotmail.com [This message has been edited by Ken Savela (edited September 19, 2001).]
[This message has been edited by Ken Savela (edited September 19, 2001).]