Concurrency
Building H2O — Semaphores + CyclicBarrier
Coordinate hydrogen and oxygen threads so they always form complete H2O molecules — never a stray atom — using two semaphores to enforce stoichiometry and a CyclicBarrier to synchronize the triplet.
Aug 10, 2026