7 ms·
I think parent is saying overcommit with OS threads. 4k requests = 4k OS threads. That would lead to the problems parent is talking about.
by detinho 2y ago
I think parent is saying overcommit with OS threads. 4k requests = 4k OS threads. That would lead to the problems parent is talking about.
- immibis 2y agoWhy wouldn't 4k virtual threads lead to the same problems?
- troupo 2y agoBecause they don't create 4k real threads, and can be scheduled on n=CPU Cores OS threads
- immibis 2y ago4k "real" threads can also be scheduled on 4 CPU cores. What's the difference?
- troupo 2y agoReal threads are extremely expensive both in terms of memory and CPU time compared to virtual threads. I think the main issue is not even that but context switching when switching threads which is also very expensive. Virtual threads usually require significantly fewer resources to spawn and run. And, if the underlying system is implemented with them in mind, they can use fewer context switches, and possibly even fewer cache misses etc.