Hi... On Wed, May 28, 2008 at 11:31 AM, Shyamal Shukla <shyamalshukla@xxxxxxxxx> wrote: > Hi All, > > If a process issues the Clone() system call with the flag > CLONE_THREAD, this creates a new thread within the thread group of the > caller. AFAIK yes... > How does scheduling of multiple threads in a thread group happen? I remember > reading that each process has a single mm_struct. I assumed that all threads > would share the same mm_struct and that scheduling will be based on these > mm_structs. nope, scheduling is generally based on priority and sleep time. In 2.4, there is a consideration to pick thread of the same thread group over normal process but AFAIK in 2.6 CFS scheduler, it is no longer taken as consideration. However, to prevent inverted priority and to provide fast scheduling between threads in same group, IIRC there is formula in CFS so that in certain way, these threads get higher "score", assuming their dynamic priority is the same. > In case my assumptions are correct, how are threads scheduled? They are all considered as process, be it process, thread or kernel thread. The difference just lies on priority. regards, Mulyadi. -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ