10 — Resources¶
The primary sources¶
Every page here can be checked against these. Where a page says what a language promises, it links one of them rather than paraphrasing from memory.
Rust
std::thread↗ — the module documentation, including what happens to the other threads when the main thread ends.thread::scope↗ — the construct that waits.- Rust Atomics and Locks ↗ — Mara Bos's book, free to read online. Its first chapter's first program is where Who waits when main returns? starts.
Go
- The Go Programming Language Specification ↗ — the sections Go statements and Program execution. The Go Memory Model ↗ — what one goroutine may assume about what another has written.
sync↗ —WaitGroup,Mutex,Once.
C
- POSIX threads:
pthread_create↗,pthread_join↗,pthread_exit↗, in POSIX.1-2024. - The
mainfunction ↗ on cppreference — what returning frommainmeans.
C++
- Concurrency support library ↗ on cppreference —
std::thread,std::jthread,std::async,std::future, mutexes and atomics.
Java
java.lang.Thread↗ andjava.util.concurrent↗, for Java 25.- JEP 444: Virtual Threads ↗ and JEP 512: Compact Source Files and Instance Main Methods ↗ — the second is why the Java examples here have no class declaration.
Python
threading↗ andconcurrent.futures↗.- PEP 703: Making the Global Interpreter Lock Optional ↗ — the free-threaded build.
Books¶
The concurrency books on the shelf beside this library, plus a few worth knowing that are not, grouped by the language they focus on. Each entry gives the author, publisher and year from the book's own title pages, its example code where the book names a repository, and its chapters — every chapter for a book about concurrency, only the concurrency chapters for a broader one. The concept pages cite the chapters that cover each concept, and each book lists the concepts that cite it.
| Focus | Books | On the shelf | Whole-book concurrency titles |
|---|---|---|---|
| General and cross-language | 15 | 13 | 11 |
| Rust | 13 | 13 | 4 |
| Go | 10 | 10 | 3 |
| C | 8 | 8 | 2 |
| C++ | 10 | 10 | 9 |
| Java | 9 | 8 | 3 |
| C# and .NET | 7 | 7 | 5 |
| Python | 22 | 15 | 13 |
| Haskell | 3 | 3 | 1 |
| Erlang and Elixir | 8 | 8 | 2 |
| Scala and functional programming | 7 | 7 | 1 |
| JavaScript | 7 | 7 | 3 |
| Swift | 1 | 1 | 1 |
| Other languages | 7 | 7 | 3 |
Python concurrency books have a well-kept outside list too: Jason Brownlee's Python Concurrency Books ↗ on SuperFastPython, with each book's concurrency chapters.
The same topic in the sibling libraries¶
Each row is a topic, its concept pages, the lessons here that ask about it, and the pages in the language libraries that go deeper for one language. The concept pages carry the same links concept by concept.