Three Concurrency Models — GIL, Virtual Thread, and Goroutine

CPython’s GIL serializes multithreaded execution and pushes work onto multiprocessing or asyncio. Java pinned threads 1:1 to the OS until virtual threads (Java 21) reopened the thread-per-request model. Go shipped with an M:N scheduler from day one. The model you start from decides whether your service goes thread-per-request, reactive, or multiprocess.

June 15, 2024 · 6 min read