Operating Systems: Three Easy Pieces [Concurrency Ch.3: Locks]
Locks
When you have a region of code that is a critical section, and thus needs to be protected to ensure correct operation, locks are quite useful.
As an example, assume our critical section looks like this, incrementing shared variable:
balance = b...
3omar.hashnode.dev19 min read