0 votes 0 votes What are two differences between user-level threads and kernel-level threads ? Under what circumstances is one type better than the other ? Operating System galvin operating-system threads descriptive + – akash.dinkar12 asked Mar 19, 2019 akash.dinkar12 4.2k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
1 votes 1 votes User-level threads Kernel-level threads The existence of user- level threads is unknown to the kernel. The existence of the kernel-level threads is known to the kernel. User-level threads are managed without kernel support. Kernel-level threads are managed by the operating system. user-level threads are faster to create than are kernel-level threads. Kernel-level threads are user-level threads. User-level threads are scheduled by the thread library. Kernel-level threads are scheduled by the kernel. Circumstances where kernel-level threads are better than user-level threads: If the kernel is single-threaded, then kernel-level threads are better than user-level threads, because any user-level thread performing a blocking system call will cause the entire process to block, even if other threads are available to run within the application. For example a process P1 has 2 kernel level threads and process P2 has 2 user-level threads. If one thread in P1 gets blocked, its second thread is not affected. But in case of P2 if one thread is blocked (say for I/O), the whole process P2 along with the 2nd thread gets blocked. In a multiprocessor environment, the kernel-level threads are better than user-level threads, because kernel-level threads can run on different processors simultaneously while user-level threads of a process will run on one processor only even if multiple processors are available. Circumstances where user-level threads are better than kernel-level threads: If the kernel is time shared, then user-level threads are better than kernel-level threads, because in time shared systems context switching takes place frequently. Context switching between kernel level threads has high overhead, almost the same as a process whereas context switching between user-level threads has almost no overhead as compared to kernel level threads. Himanshu Kumar Gupta answered Oct 6, 2020 Himanshu Kumar Gupta comment Share Follow See all 0 reply Please log in or register to add a comment.