中断处理程序可以被抢占吗?
我知道Linux有嵌套中断,其中一个中断可以“抢占”另一个中断,但是其他任务又如何呢?
我只是想了解linux如何处理中断。它们可以被其他用户任务/内核任务抢占吗?
I know that linux does nested interrupts where one interrupt can "preempt" another interrupt, but what about with other tasks.
I am just trying to understand how linux handles interrupts. Can they be preempted by some other user task/kernel task.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
阅读 为什么在中断上下文中执行的内核代码/线程无法休眠? 链接到 Robert Loves 文章,我读了这个:
所以我知道在中断处理程序中所有 IRQ 都被禁用,因此它不能被中断!?
Reading Why kernel code/thread executing in interrupt context cannot sleep? which links to Robert Loves article, I read this :
So AFIK all IRQ's are disabled while within the interrupt handler, therefore it cannot be interrupted!?
简单回答:中断只能被更高优先级的中断打断。
因此,如果中断的优先级低于内核调度程序中断优先级或用户任务中断优先级,则中断可以被内核或用户任务中断。
请注意,“用户任务”是指用户定义的中断。
Simple answer: An interrupt can only be interrupted by interrupts of higher priority.
Therefore an interrupt can be interrupted by the kernel or a user task if the interrupt's priority is lower than the kernel scheduler interrupt priority or user task interrupt priority.
Note that by "user task" I mean user-defined interrupt.