以下哪一项是错误的?
(A)内核不调度用户级线程。
(B)当一个用户级线程被阻塞时,其进程的所有其他线程都被阻塞。
(C)用户级线程之间的上下文切换比内核级线程之间的上下文切换更快。
(D)内核级线程不能共享代码段答案: (D)
解释:
User level thread | Kernel level thread |
---|---|
User thread are implemented by user processes. | 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. |
资料来源:https://www.geeksforgeeks.org/difference-between-user-level-thread-and-kernel-level-thread/
这个问题的测验