Programming: Process Context and Interrupt Context

Published:

The comparison between process and interrupt contexts.

Contents:

What is Contexts?

Context is the task’s state stored so that it can resume execution when scheduling back from the scheduling queue.

Differences Between Process and Interrupt Contexts

The process context is the state of a user-mode running task, which is pointed by current.

The interrupt context is the environemnt when the kernel handles an interrupt.

A deferrable action of the interrupt can be stored in the workqueue and run in process context.

  Process Context Interrupt Context
Sleep? Yes No
Time Critical? No Yes
Context switch? Yes No
Access User Memory? Yes No

Useful Links

  • [Interrupts Linux Kernel Labs](https://linux-kernel-labs.github.io/refs/heads/master/lectures/interrupts.html)