Please correct me if I am wrong:
I wrote a simple C program which starts two threads, each repeatedly increments
a counter and never returns. On running it on Solaris 8 I find the second thread
never runs. I assume this is because mine are user-level threads, invisbible to the
kernel and no context switching occurs since there is no pre-emption nor do I
make any system calls. If I bind the threads to LWPs I do see context-switching
since they are now visible to the kernel and it implements RR scheduling. On
Solaris 9, without binding, both threads are run, I guess the updated pthread
library implements pre-emption unlike that with Solaris 8.
On Linux, since we have kernel-level threads, both threads are run in an RR
Are these threads grouped together in a data structure associated with the
process that created them?
Is a time-slice assigned to each process and then divided up amongst runnable
threads within that process's thread group?
Or are all threads, irrespective of parent process, held in a single queue and
served in a RR fashion?
I am guessing all threads in the same process are served successively to save
on process context switches, am I right?