Don’t skip the discussion on advisory locks. In my experience nearly every nontrivial application that spans multiple machines has concurrency bugs that advisory locks are perfectly suited to fix.
replies(4):
Here’s a good issue describing the tradeoffs between a lock table and advisory locks.