Sunday, March 9, 2014

Why Kernel Code running in interrupt context cannot sleep?

This is because the kernel design architecture wants it to be like this. Why so?

This is because interrupt context is not considered to be a process.So, it can't sleep.The interrupt code is doing some work on behalf of process and if slept then it will not only lead to the blocking of interrupt code but also the process that has called it .

3 comments:

  1. This comment has been removed by the author.

    ReplyDelete
    Replies
    1. While the isr() is being executed the scheduler would be disabled, if isr() is sleeping, then nobody would be there to wakeup isr() and even the process.

      Delete
  2. Because if Codes are running in interrupt context have no task_struct structure which is used by scheduler to access the process state while it sleeping.

    ReplyDelete