Related: [[Concurrency]], [[Future]]
# History
Heavily told from the JavaScript perspective.
## C10k Problem
[Wikipedia](https://en.wikipedia.org/wiki/C10k_problem)
[Kegel's page](http://www.kegel.com/c10k.html) popularized this notion - It was a *common knowledge* *\[citation needed\]* that thread based servers cannot handle 10,000 concurrent connections.
Kegel's page covers many things; including
* Limits of threading in popular operating systems. limits on the number of kernel threads. size of stack frame.
* Go gets around this via both A) userspace threads and B) userspace stack.
* Event-based IO - select, poll, epoll, kqueue. [[Reactor Pattern]]
* State of the world - [libevent](https://libevent.org/)
* Node.JS uses `libuv` behind the scene - [link](https://www.geeksforgeeks.org/libuv-in-node-js/)
* libuv vs libev - https://gist.github.com/andreybolonin/2413da76f088e2c5ab04df53f07659ea
This was an inspiration for [[Node.JS]].
> [!quote] [JSConf 2009](https://www.jsconf.eu/2009/speaker/speakers_selected.html)
> It is well known that event loops rather than threads are required for high-performance servers. Javascript is a language unencumbered of threads and designed specifically to be used with synchronous evented I/O, making it an attractive means of programming server software. [Node.js](http://tinyclouds.org/node) ties together the V8 Javascript compiler with an event loop, a thread pool for making blocking system calls, and a carefully designed HTTP parser to provide a browser-like interface to creating fast server-side software. This talk will explain Node's design and how to get started with it.
## [[Dark days of callback]]
# [[Concurrent and Parallel Programming Primitives]]
# Different Languages
- [[JavaScript]]
- [[Modern Python]]