| Section | Title |
|---|---|
| 1 | Threads in Zig |
| 2 | Mutexes |
| 3 | Atomics |
| 4 | Condition Variables |
| 5 | Async Functions |
| 6 | Await and Suspension |
| 7 | Event Loops |
| 8 | Channels and Queues |
| 9 | Data Races |
| 10 | High Performance Concurrent Design |
Threads in ZigA thread is a separate path of execution inside one program.
MutexesA mutex is a lock for shared data.
AtomicsAn atomic operation is a small operation that can safely happen while several threads are running.
Condition VariablesA condition variable lets one thread sleep until another thread says that something has changed.
Async FunctionsAsync code lets a program start an operation now and receive the result later.
Await and Suspensionawait means: wait until an asynchronous operation has finished, then continue with its result.
Event LoopsAn event loop is code that waits for events, then runs the right piece of work for each event.
Channels and QueuesA queue is a data structure for passing work from one part of a program to another.
Data RacesA data race happens when two threads access the same memory at the same time, at least one access writes, and there is no proper synchronization.
High Performance Concurrent DesignHigh performance concurrent design means using several threads or tasks without making the program slower, more fragile, or harder to reason about.