3 ms·
Does anyone have numbers to back this claim? Seems like for IO focused software you'll have a lot of dead CPU time. If you have more threads than cores, you can
by virmundi 9y ago
Does anyone have numbers to back this claim? Seems like for IO focused software you'll have a lot of dead CPU time. If you have more threads than cores, you can take advantage of that.
- ma2rten 9y agoAsynchronous programming is also solving that problem by using an event loop.
- jandrewrogers 9y agoNo dead CPU time in well-designed software. If you care about I/O performance then you are managing that in user space asynchronously. No thread is waiting for I/O to complete or anything like that unless there is literally nothing else to do (in which case more threads won't help). There is no performance benefit to adding more threads, they would increase CPU state/cache thrashing which will slow things down. The main benefit of using a lot of threads is that more programmers know how to design software that way because it was taught for so many years; it isn't good for performance on modern hardware.
- jorangreef 9y ago"Seems like for IO focused software you'll have a lot of dead CPU time. If you have more threads than cores, you can take advantage of that." Yes, see here for more discussion on this: https://github.com/ronomon/crypto-async#adjust-threadpool-size-and-control-concurrency https://github.com/ronomon/crypto-async#adjust-threadpool-si...