3 ms·
It has always been a bad idea to dispatch so naively and dispatch to the same number of threads as you have cores. What if a couple cores are busy, and you spe
by Dylan16807 2y ago
It has always been a bad idea to dispatch so naively and dispatch to the same number of threads as you have cores. What if a couple cores are busy, and you spend almost twice as much time as you need waiting for the calculation to finish? I don't know how much software does that, and most of it can be easily fixed to dispatch half a million rows at a time and get better performance on all computers.
Also on current CPUs it'll be affected by hyperthreading and launch 28 threads, which would probably work out pretty well overall.
- chmod775 2y ago> What if a couple cores are busy If you don't pin them to cores, the OS is still free to assign threads to cores as it pleases. Assuming the scheduler is somewhat fair, threads will progress at roughly the same rate.
- Dylan16807 2y agoI would not assume it's sufficiently fair to make that a good algorithm. Even a small bias could turn a 5 minute calculation into a 6 or 7 minute calculation as the stragglers finish up.