Coordination and scarcity

Hub — LLD concurrency

Decision-tree hub for Lattice LLD concurrency: basics, correctness, coordination, and scarcity — which post to open for shared state, handoffs, and limited pools.

The four posts

Coord and scarcity
Handoff vs limited resources — after correctness.
01Basics

Threads, races, vocabulary

02Correctness

Locks, ownership, invariants

03Coordination

Queues, backpressure, async

04Scarcity

Semaphores, pools, budgets

  • Concurrency basics — map of the family; start here if vocabulary is fuzzy.
  • Correctness — don’t corrupt shared state; lock scope; happens-before intuition.
  • Coordination — blocking queues, wait/notify, backpressure, async pipelines, bursts.
  • Scarcity — semaphores, connection/GPU pools, memory/bandwidth budgets.

Decision tree — which post to open

Answer the first question that matches; open only that deep dive for today’s 35 minutes.

  1. Do I still confuse race vs deadlock vs starvation? → Basics.
  2. Is the bug “two threads broke my invariant”? → Correctness (parking last spot, seat hold, inventory transfer).
  3. Is the problem “work must move between threads / absorb bursts”? → Coordination (logger async sink, resize/email pipeline, actor mailbox).
  4. Is the problem “too many want a limited resource”? → Scarcity (DB pool, GPU slots, rate of admits into a critical section).
  5. Unsure? Correctness first. Coordination and scarcity are follow-up families — don’t mix both in one timed session.

How to use this hub

← Lattice