2 ms·
Decent nits, but... Short-lived threads (for one request) are a performance and scalability disaster; tens of microseconds or worse to spawn and join, contenti
by mlyle 6y ago
Decent nits, but...
Short-lived threads (for one request) are a performance and scalability disaster; tens of microseconds or worse to spawn and join, contention on important locks, bad for caches, etc. There's not much concurrency when it comes to spawning threads, too.
If you have long-lived threads in a pool, yes, they may not live forever, but you generally have to assume that each thread will end up with a resident stack size equal to the largest stack use: each will get a turn to run the stack-intensive functions.