Implemented by | by users | by Operating System |
Recognize | OS doesn’t recognize user-level threads. | Kernel threads are recognized by Operating System. |
Implementation | easy. | complicated. |
Context switch time | Context switch time is less. | Context switch time is more. |
Hardware support | Context switch requires no hardware support. | Hardware support is needed. |
Blocking operation | If one user-level thread performs a blocking operation then the entire process will be blocked. | If one kernel thread performs a blocking operation then another thread can continue execution. |
Multithreading | Multithread applications cannot take advantage of multiprocessing. | Kernels can be multithreaded. |
Creation and Management | User-level threads can be created and managed more quickly. | Kernel-level level threads take more time to create and manage. |
Operating System | Any operating system can support user-level threads. | Kernel-level threads are operating system-specific. |
Thread Management | The thread library contains the code for thread creation, message passing, thread scheduling, data transfer, and thread destroying | The application code does not contain thread management code. It is merely an API to the kernel mode. The Windows operating system makes use of this feature. |
Example | Java thread, POSIX threads. | Window Solaris. |
Advantages | User Level Threads are simple and quick to create. Can run on any operating system They perform better than kernel threads since they don’t need to make system calls to create threads. In user-level threads, switching between threads does not need kernel mode privileges. | Scheduling multiple threads that belong to the same process on different processors is possible in kernel-level threads. Multithreading can be there for kernel routines. When a thread at the kernel level is halted, the kernel can schedule another thread for the same process. |
Disadvantages | Multithreaded applications on user-level threads cannot benefit from multiprocessing. If a single user-level thread performs a blocking operation, the entire process is halted. | Transferring control within a process from one thread to another necessitates a mode switch to kernel mode. Kernel-level threads take more time to create and manage than user-level threads. |
Memory management | In user-level threads, each thread has its own stack, but they share the same address space. | In kernel-level threads have their own stacks and their own separate address spaces, so they are better isolated from each other. |
Fault tolerance | User-level threads are less fault-tolerant than kernel-level threads. If a user-level thread crashes, it can bring down the entire process. | Kernel-level threads can be managed independently, so if one thread crashes, it doesn’t necessarily affect the others. |
Resource utilization | User-level threads don’t take full advantage of the system resources, As they don’t have direct access to the system-level features like I/O operations | It can access to the system-level features like I/O operations.So it can take full Advantages of System Resources. |
Portability | User-level threads are more portable than kernel-level threads. | Kernel-level threads are less portable than User-level threads |