top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is the difference between kernel level thread and user level thread?

+4 votes
3,883 views
What is the difference between kernel level thread and user level thread?
posted Jul 18, 2015 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

User level thread

In this case, application manages thread management kernel is not aware of the existence of threads. The thread library contains code for creating and destroying threads, for passing message and data between threads, for scheduling thread execution and for saving and restoring thread contexts. The application begins with a single thread and begins running in that thread.

Advantages

Thread switching does not require Kernel mode privileges.

User level thread can run on any operating system.

Scheduling can be application specific in the user level thread.

User level threads are fast to create and manage.

Disadvantages

In a typical operating system, most system calls are blocking.

Multithreaded application cannot take advantage of multiprocessing.

Kernel Level Threads

In this case, thread management done by the Kernel. There is no thread management code in the application area. Kernel threads are supported directly by the operating system. Any application can be programmed to be multithreaded. All of the threads within an application are supported within a single process.

The Kernel maintains context information for the process as a whole and for individuals threads within the process. Scheduling by the Kernel is done on a thread basis. The Kernel performs thread creation, scheduling and management in Kernel space. Kernel threads are generally slower to create and manage than the user threads.

Advantages

Kernel can simultaneously schedule multiple threads from the same process on multiple processes.

If one thread in a process is blocked, the Kernel can schedule another thread of the same process.

Kernel routines themselves can multithreaded.

Disadvantages

Kernel threads are generally slower to create and manage than the user threads.

Transfer of control from one thread to another within same process requires a mode switch to the Kernel.

Differences b/w user and kernal level threads

User Level Threads

User level threads are faster to create and manage.

Implementation is by a thread library at the user level.

User level thread is generic and can run on any operating system.

Multi-threaded application cannot take advantage of multiprocessing.

Kernel Level Thread

Kernel level threads are slower to create and manage.

Operating system supports creation of Kernel threads.

Kernel level thread is specific to the operating system.

Kernel routines themselves can be multithreaded.

answer Jul 20, 2015 by Manikandan J
...