I have implemented meta-heuristic solver and utilized .NET 4.0 Parallel.For
and Parallel.Foreach
.
It works fines on my medium-end machine. But the search is too intensified and consumes too much resources especially the CPU time on that on lower-end machine.
So I think I have to put an option to tune down intensity of the search when needed. I would like to get CPU utilization down without much touch on an algorithm. It is fine if the search completes slower as long as it won't lock up the machine and allows the other work aside.
I'm considering to put Thread.Sleep
on methods as all threads are 100% CPU bound (no I/O). Does that gonna decrease intensity of CPU usage I need? Is there any better solution?