8.2 Interrupts

It should be noted that a hardware interrupt (see Chapter Nine) does not directly cause a call on “swtch” or its equivalent. A hardware interrupt will cause a user process to revert to a kernel process, which as just noted, may call “swtch” as an alternative to reverting to user mode after the interrupt handling is complete.

If a kernel process is interrupted, then after the interrupt has been handled, the kernel process resumes where it had left off regardless. This point is important for understanding how UNIX avoids many of the pitfalls associated with “critical sections” of code, which are discussed at the end of this chapter.