| Section | Title |
|---|---|
| 1 | Threads |
| 2 | Mutexes |
| 3 | Atomics |
| 4 | Condition Variables |
| 5 | Async Status in Zig 0.16 |
| 6 | Thread Pools |
| 7 | Semaphores |
| 8 | Designing Concurrent Programs |
| 9 | A Parallel File Scanner |
ThreadsA thread is an independent flow of execution.
MutexesA mutex is a lock for shared data.
AtomicsA mutex makes one thread wait while another thread uses shared data.
Condition VariablesA mutex protects shared data.
Async Status in Zig 0.16Zig once had async functions as a language feature.
Thread PoolsCreating a thread is expensive.
SemaphoresA semaphore is a counter used for synchronization.
Designing Concurrent ProgramsThreads are a mechanism, not a design.
A Parallel File ScannerThis section combines the ideas from the previous sections into one program structure.