📜  门| GATE-CS-2004 |问题 11

📅  最后修改于: 2021-09-25 06:48:39             🧑  作者: Mango

考虑以下关于用户级线程和内核支持的线程的陈述

i.   context switch is faster with kernel-supported threads
ii.  for user-level threads, a system call can block the 
     entire process
iii. Kernel supported threads can be scheduled independently
iv.  User level threads are transparent to the kernel

以上哪些说法是正确的?
仅 (A) (ii)、(iii) 和 (iv)
(B) (ii) 和 (iii) 仅
(C) (i) 和 (iii) 仅
(D) (i) 和 (ii) 仅答案:(一)
解释:

User level thread Kernel level thread
User thread are implemented by users. kernel threads are implemented by OS.
OS doesn’t recognized user level threads. Kernel threads are recognized by OS.
Implementation of User threads is easy. Implementation of Kernel thread is complicated.
Context switch time is less. Context switch time is more.
Context switch requires no hardware support. Hardware support is needed.
If one user level thread perform blocking operation then entire process will be blocked. If one kernel thread perform blocking operation then another thread can continue execution.
Example : Java thread, POSIX threads. Example : Window Solaris.

http://en.wikipedia.org/wiki/Thread_%28computer_science%29

https://www.geeksforgeeks.org/difference-between-user-level-thread-and-kernel-level-thread/
这个问题的测验