Synchronization

Synchronization #

Scope #

  • The Critical Section problem
  • Three correctness conditions: Mutual Exclusion, Progress, Bounded Waiting
  • Peterson’s Algorithm
  • Memory view inconsistency (Cache, Store Buffers)
  • Hardware instruction reordering
  • Hardware memory models
  • Impact of the compilation process
  • C11+ memory model
  • Memory barriers
  • Hardware synchronization support: Read-Modify-Write operations
  • Atomic Swap (XCHG)
  • Test-and-Set (TAS)
  • Compare-and-Swap (CAS / cmpxchg)
  • Spinlocks and the busy-waiting problem
  • Dijkstra’s system semaphores
  • Linux Futex (Fast Userspace Mutex)

Reference #

  1. Lecture Slides
  2. Code samples
  3. Textbook: chapters: Process Synchronization, Deadlocks.
  4. Old slides: Sync_2.pdf