User level thread vs Kernel level thread in Operating System (OS)

User Level Thread Vs Kernel Level Thread

On this page we will discuss about User Level Thread Vs Kernel Level Thread in Operating System. Both are important concept and it is necessary to understand the difference between them.
User Level Thread Vs Kernel Level Thread​

Difference Between User Level and Kernel Level Threads

User Level Thread

Features of User Level Thread

  • Implemented by user and managed by run-time system (user-level library).
  • OS is not aware of existence of threads.
  • OS manages the user level threads as if they are single threaded process.
  • Creation of thread switching between thread and synchronizing thread are all done via procedural call.

Advantage of User Level Thread-

  • Are extremely fast and efficient, because the switching between thread takes almost same time as a procedural call.
  • OS doesn’t need to interfere ,everything can be without it.
  • They do not modify OS.
  • Threads are cheap and fast at user level.
  • User level thread can be implemented in OS, who do not implement threads.

Disadvantage of User Level Thread-

  • Since OS isn’t aware of user level thread , scheduler does not schedule them properly. Eg -> Java thread, POSIX thread etc.
  • If 1 user level thread performs blocking operation, entire process will be blocked.

Kernel Level Thread

Features of Kernel Level Thread –

  • OS managed threads.
  • OS knows about and manages the thread.
  • Kernel has a thread table which keeps tracks of all threads in the system.
  • System calls create and manage threads.

Advantages of Kernel Level Thread ->

  • As kernel has full knowledge of threads, so scheduler handles the processes better.
  • For application that frequently block, Kernel level threads are good.

Disadvantages of Kernel Level Thread ->

  • Slow and inefficient than user level.
  • Hardware support is needed.
  • Context switching time is more. Eg – Window Solaris
  • If  1 kernel thread performs blocking operation, then another thread can continue execution.

User Level Threads
VS
Multi-Threaded Model

User level ThreadsMulti Threaded Model
User thread are implemented by UsersKernal threads are implemented by OS
OS doesn’t recognise user level threadsKernel threads are recognized by OS
Implementation is easyImplementation is complicated
Context switch time is lessContext switch time is more
Context switch – no hardware supporthardware support is needed
If one user level thread perform blocking operation then entire process will be blockedIf one kernel level thread perform blocking operation then another thread can continue execution.

Prime Course Trailer

Related Banners

Get PrepInsta Prime & get Access to all 200+ courses offered by PrepInsta in One Subscription

Get over 200+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others

Checkout list of all the video courses in PrepInsta Prime Subscription

Checkout list of all the video courses in PrepInsta Prime Subscription