Deadlocks

1

Locks, Deadlocks, and Priority Inversion

9 minute

Many concurrency bugs trigger the same first reaction: add a lock. That is only half right.

A lock can protect shared state, but it does not make concurrency problems disappear. It turns “multiple execution flows modify data at the same time” into rules about who enters first, who waits, and who releases. If those rules are poorly designed, the system may stop corrupting data and instead start hanging, stalling, timing out, or delaying high-priority work.

Read More