内核如何一直运行? [英] How can kernel run all the time?

查看:108
本文介绍了内核如何一直运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当CPU一次只能执行一个进程时,内核如何一直运行? 也就是说,如果内核一直在占用CPU,那么其他进程将如何运行.

How can kernel run all the time, when CPU can execute only one process at a time ? That is, if kernel is occupying CPU all the time , then how come other processes run.

请解释 谢谢

推荐答案

以相同的方式,您可以同时运行多个用户空间进程:在任何给定时间,实际上只有一个正在使用CPU.您有一些中断迫使他们放弃.

In the same way that you can run multiple userspace processes at the same time: Only one of them is actually using the CPU at any given time. You have some interrupts that force them to give it up.

作为操作系统一部分的代码在这里没有什么不同(除了它首先控制着设置此调度).

Code that is part of the operating system is no different here (except that it is in control of setting up this scheduling in the first place).

您还必须区分由操作系统在后台运行的进程(我想这就是您在这里所说的)和系统调用(作为正常"进程的一部分运行,这些进程会暂时切换到超级用户)模式).

You also have to distinguish between processes run by the OS in the background (I suppose that is what you are talking about here), and system calls (which are being run as part of "normal" processes that temporarily switch into supervisor mode).

这篇关于内核如何一直运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆