[prev] 16 [next]

Lock-based Concurrency Control (cont)

Synchronise access to shared data items via following rules:
  • before reading X, get read (shared) lock on X
  • before writing X, get write (exclusive) lock on X
  • a tx attempting to get a read lock on X is blocked if another tx already has write lock on X
  • a tx attempting to get an write lock on X is blocked if another tx has any kind of lock on X
These rules alone do not guarantee serializability.