线程之间的上下文切换
我对linux内核有一些疑问,假设我的进程中有两个线程,如果一个线程试图读取一些信息并且由于发生页面错误,第二个线程是否会被阻塞?提前致谢
I have some question about linux-kernel, let's assume that I have two threads in my process, if one thread was trying to read some info and because of it occured page fault, the second thread will be blocked or not? thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当一个线程由于某种原因阻塞时,其他所有线程都可以自由运行。这是内核线程 (1:1) 与用户线程 (N:1) 的主要优点。
基本上在这种情况下,每个线程都是一个
KSE
(内核调度实体)并且是独立调度的。When one thread blocks for whatever reason, every other thread is free to run. This is the main advantage of kernel threads (1:1) versus user threads (N:1).
Basically in this context, each thread is a
KSE
(Kernel Scheduling Entity) and is scheduled independently.