Thursday, 25 June 2015


A thread is an independent sequence of execution within the context of a parent process. Threads share the resources of parent process but are separately and independently scheduled. Aside hybrid threads, there are two main kinds of threads – user-level threads and kernel-level threads. In user-level threads, the kernel knows nothing about user-level threads and manages them as if they were single threaded processes while in kernel-level threads; the kernel knows about and manages the threads. This write up is all about comparing implementation of kernel-level and user-level threads in the four operating systems listed above.

An important characteristics of windows operating system is its support for threads. Windows support the use of multiple threads of execution within a single process. Multiple threads within the same process may execute on different processors (using symmetric multiprocessing) simultaneously. Windows uses one to one relationship thread model. That is there is one to one relationship of user level thread to the kernel level thread. Each user-level thread simply
maps on to its own kernel-level thread. In windows, each thread contains separate user and kernel stacks.

Traditional UNIX systems support a single thread of execution per process, while modern UNIX systems typically support multiple kernel level threads per process. UNIX implements many to one model which maps many user level threads to one Kernel level thread. Thread management is done in user space. When thread makes a blocking system call, the entire process will be blocks. Only one thread can access the Kernel at a time, so multiple threads are unable to run in parallel on multiprocessors

Linux has a unique implementation of threads. To the Linux kernel, there is no concept of a thread. Linux implements all threads as standard processes. The Linux kernel does not provide any special scheduling semantics or data structures to represent threads. Instead, a thread is merely a process that shares certain resources with other processes. Using a mechanism similar to the lightweight processes of Solaris, user-level threads are mapped into kernel-level processes. Multiple user-level threads that constitute a single user-level process are mapped into kernel-level processes that share the same group ID.

Solaris implements multilevel thread support designed to provide considerable flexibility in exploiting processor resources. In Solaris, user-level threads is implemented through a threads library in the address space of a process. These are invisible to the OS. The kernel threads are fundamental entities that can be scheduled and dispatched to run on one of the system processors.

Some operating systems like Windows distinguish the concept of process and threads while others like Linux does not. UNIX operating system and some of its variants share common attributes including threads implementation.


Post a Comment

Add a comment here