3 ms·
Ultimately the problem is "the system needs to retain enough state per connection to resume executing the 'next' step of the communication". This state is curr
by pjc50 9y ago
Ultimately the problem is "the system needs to retain enough state per connection to resume executing the 'next' step of the communication".
This state is currently split into different pieces and spread around the system. The operating system maintains the TCP state, for example. If you use threads to partition connections, the operating system looks after the instruction pointer to resume a non-running thread at. The program (whatever language) will usually have some kind of stream state and maybe buffers.
It's all a question of where you want to put the abstraction boundaries. Heavy threads? Light threads? Async? Continuations? Or go the other way and have process-per-core with userland drivers and TCP state, where each process is just listening for interrupts and handles everything from there?
- zbentley 9y ago> Or go the other way and have process-per-core with userland drivers and TCP state, where each process is just listening for interrupts and handles everything from there? A kernel. You are describing a kernel, minus workers, plus a web server.
- pjc50 9y agoI was thinking of things like https://shader.kaist.edu/mtcp/ https://shader.kaist.edu/mtcp/ , or https://github.com/snabbco/snabb https://github.com/snabbco/snabb or these kind of things: https://jvns.ca/blog/2016/06/30/why-do-we-use-the-linux-kernels-tcp-stack/ https://jvns.ca/blog/2016/06/30/why-do-we-use-the-linux-kern...