Kernel Synchronization (Linux)
You could think of the kernel as a server that answers requests; these requests can
come either from a process running on a CPU or an external device issuing an inter-
rupt request. We make this analogy to underscore that parts of the kernel are not run
serially, but in an interleaved way. Thus, they can give rise to race conditions, which
must be controlled through proper synchronization techniques. A general introduc-
tion to these topics can be found in the section “An Overview of Unix Kernels” in
.
We start this chapter by reviewing when, and to what extent, kernel requests are exe-
cuted in an interleaved fashion. We then introduce the basic synchronization primi-
tives implemented by the kernel and describe how they are applied in the most
common cases. Finally, we illustrate a few practical examples.