阻止或休眠中断处理程序
假设:
1) 多CPU环境
2) 被中断的进程与执行中断处理程序的进程是同一进程,所以我想从技术上讲,除了进程之前正在执行的操作之外,没有任何内容会被中断,但它在执行处理程序时仍在执行.
3) 没有上半部分或下半部分,当发生中断时,处理程序被调用、执行,然后从中断返回,就这么简单。
为什么休眠处理程序(放入睡眠队列,上下文切换到下一个可运行进程)是一个坏主意?
Assume:
1) Multi-cpu environment
2) Process that gets interrupted, is the same process that executes the interrupt handler, so I guess technically nothing gets interrupted except what the process was doing before, but it is still executing as it is executing the handler.
3) There is no top or bottom half, when an interrupt takes place the handler is invoked, executes, then return from interrupt, simple as that.
Why would sleeping the handler (puts in sleep queue, context switch to next runnable process) be a bad idea?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅为什么内核代码/线程在中断上下文中执行无法休眠?
我刚刚发布了答案。希望这对你有意义。
Pls refer to Why kernel code/thread executing in interrupt context cannot sleep?
I just posted answer. Hope it makes sense for you.