gpt4 book ai didi

linux - 中断处理程序可以被抢占吗?

转载 作者:IT王子 更新时间:2023-10-29 00:55:56 25 4
gpt4 key购买 nike

我知道 linux 会嵌套中断,其中一个中断可以“抢占”另一个中断,但是其他任务呢。

我只是想了解 linux 是如何处理中断的。它们能否被其他一些用户任务/内核任务抢占。

最佳答案

阅读 Why kernel code/thread executing in interrupt context cannot sleep?链接到 Robert Loves article ,我读了这个:

some interrupt handlers (known in Linux as fast interrupt handlers) run with all interrupts on the local processor disabled. This is done to ensure that the interrupt handler runs without interruption, as quickly as possible. More so, all interrupt handlers run with their current interrupt line disabled on all processors. This ensures that two interrupt handlers for the same interrupt line do not run concurrently. It also prevents device driver writers from having to handle recursive interrupts, which complicate programming.

所以 AFIK 所有 IRQ 在中断处理程序中都被禁用,因此它不能被中断!?

关于linux - 中断处理程序可以被抢占吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5934402/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com