阻止或休眠中断处理程序

发布于 2024-10-05 07:13:22 字数 259 浏览 0 评论 0原文

假设:
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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

灵芸 2024-10-12 07:13:22

请参阅为什么内核代码/线程在中断上下文中执行无法休眠?

我刚刚发布了答案。希望这对你有意义。

Pls refer to Why kernel code/thread executing in interrupt context cannot sleep?

I just posted answer. Hope it makes sense for you.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文