Operating-Systems-Notes

Synchronization

Waiting for other processes, so that they can continue working together

Limitation of mutextes and condition variables

Low-level support: hardware atmoic instructions

Synchronization constructs

  1. Spinlocks (basic sync construct)
    • Spinlock is like a mutex - mutual exclusion
      • lock and unlock(free)
      • but, lock == busy => spinning
  2. Semaphores
    • common sync construct in OS kernels
    • like a traffic light: Stop and Go
    • like mutex, but more general

Semaphore == integer value

Syncing different types of accesses

Reader/Writer locks

read (don't modify) write (always modify)
shared access exclusive access

Monitors (highlevel construct)

More synchroniaztion constructs

All need hardware support.

Need for hardware support

Atomic instructions

Critical section with hardware supported synchronization

Hardware specific

Guarantees

Shared Memory Multiprocessors

Also called symmetric multiprocessors (SMP)

sharedmmmp

Cache Coherence

cachecoherence

cachecoherence2