Lock intro
What is a Lock?
A lock is like a public restroom (shared resource) with only one stall (critical section) and a key (lock) hanging at the front desk.
Why use a lock?
-
Stops multiple servers or procceses or concurrent calls from corrupting shared data by allowing only one server or procces or concurrent call at a time.
-
Guarantees operations complete fully before others see changes.