用户空间进程是否抢占了内核线程?

用户空间进程是否抢占了内核线程?,第1张

概述目前我正在阅读“理解Linux内核,第3版”,在第22页,我可以阅读: In the simplest case, the CPU executes a kernel control path sequentially from the first instruction to the last. When one of the following

目前我正在阅读“理解Linux内核,第3版”,在第22页,我可以阅读:

In the simplest case,the cpu executes a kernel control path sequentially from the
first instruction to the last. When one of the following events occurs,however,the
cpu interleaves the kernel control paths:

A process executing in User Mode invokes a system call,and the corresponding
kernel control path verifIEs that the request cannot be satisfIEd immediately; it
then invokes the scheduler to select a new process to run. As a result,a process
switch occurs. The first kernel control path is left unfinished,and the cpu
resumes the execution of some other kernel control path. In this case,the two
control paths are executed on behalf of two different processes.

内核控制路径可以从进行系统调用的用户空间进程中断?
我认为优先级非常重要:

>中断
>内核线程
>用户空间流程

我检查了勘误表,但却找不到任何相关信息.最佳答案你对优先权清单是正确的,但这本书试图说的是(我认为):

>当(用户)进程进行系统调用时,内核会代表它开始执行.
>如果系统调用可以完成(内核控制路径没有遇到障碍),那么它通常会直接返回到调用进程 – 想想getpID()函数调用.
>另一方面,如果系统调用无法完成(例如,因为磁盘系统必须在将数据返回到调用进程之前将块读入内核缓冲池),则调度程序用于选择要运行的新进程 – 抢占(代表用户运行的控制的内核线程)用户进程.
>在适当的时候,原始系统调用将能够继续,并且原始(代表运行的控制的内核线程)用户进程将能够继续并最终完成,将控制权返回给运行的用户空间进程在用户空间而不是在内核中.

所以“不”:不是’内核路径可以从进行系统调用的用户空间进程中断’的情况.

代表用户空间进程执行系统调用时,内核路径可能会被中断,原因是:发生中断,或者内核路径必须等待资源变为可用,或者……

总结

以上是内存溢出为你收集整理的用户空间进程是否抢占了内核线程?全部内容,希望文章能够帮你解决用户空间进程是否抢占了内核线程?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/1047223.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-25
下一篇 2022-05-25

发表评论

登录后才能评论

评论列表(0条)

保存