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.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 Threads | Multi Threaded Model |
---|---|
User thread are implemented by Users | Kernal threads are implemented by OS |
OS doesn’t recognise user level threads | Kernel threads are recognized by OS |
Implementation is easy | Implementation is complicated |
Context switch time is less | Context switch time is more |
Context switch – no hardware support | hardware support is needed |
If one user level thread perform blocking operation then entire process will be blocked | If 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
Login/Signup to comment