4 ms·
Have a number of threads greater than the number of cores results in either synchronization costs or longer latency.
by mcguire 3y ago
Have a number of threads greater than the number of cores results in either synchronization costs or longer latency.
- IshKebab 3y agoNo it doesn't. It results in more context switching costs maybe, but I seriously doubt that would make a difference in all but the most extreme cases.
- mcguire 3y agoContext switching, cache coherency, and the way that, in practice, you end up with #threads >> #cores.
- bcrl 3y agoLatency is not the only cost of an excessive number of threads: context switches are expensive! Every context switch is a waste of CPU cycles that could be better spent doing actual work for your application. Furthermore, the cost of context switches keeps going up with every new generation of CPU, and I don't see that trend reversing any time soon.