I stumbled on a forum posting recently that led me to write the following code:
This program behaves badly on a single processor machine, and pegs the CPU at 100% for over two minutes. On a multi processor machine, the program finishes all the threading work in the blink of an eye - only a brief CPU spike.
Strangely, if I remove a single line of code:
… then the program performs just as well on a single processor machine (only a brief spike - comparable to the MP scenario).
Could it be a bug?
Comments
Is there any legitimate reason you need BelowNormal here? Normal gives the same results in most cases.
www.bluebytesoftware.com/...
Specifically:
"If any threads are found by the balance set manager which have been starved for ~3-4 seconds, those starved threads enjoy a temporary priority boost to priority 15 ("time critical"), virtually ensuring the thread will be scheduled."