0Pricing
Assembly Language & x86 Low-Level Systems Programming · Lesson

Synchronization and Concurrency in Kernel Space

Manage shared data safely in the kernel using spinlocks, mutexes, atomic operations, and an awareness of interrupt context versus process context.

The Concurrency Problem

Kernel code runs in a brutally concurrent environment: multiple CPUs, preemptible threads, and interrupts that fire anytime. Unprotected shared data leads to race conditions and corruption.

Process vs Interrupt Context

Kernel code runs in two contexts:

  • Process context: on behalf of a syscall; can sleep
  • Interrupt context: handling hardware; must NOT sleep

The context dictates which locking primitive is legal.

All lessons in this course

  1. Introduction to Kernel Space
  2. Writing Simple Device Drivers
  3. Interfacing with Hardware Directly
  4. Synchronization and Concurrency in Kernel Space
← Back to Assembly Language & x86 Low-Level Systems Programming