c++ - Is there any way to allow multithreading on a program with a loop like this one? -
Is
Is there a way to allow Maltithreding on a program with such a loop?
Int a = 100000, b = 50, c; While (a) {c = b * a + c; a -;}
Windows 7 / code :: blocks default Mingw C ++ compiler / dual-core 4 threaded i5 CPU with the IDE
< Div class = "post-text" itemprop = "text">
This is not per programming problem.
is using 100% of the two core program 1 core with four-core or hyperthreading on your CPU, which is reported as using 25% in Windows Task Manager.
You will not be able to 'increase your CPU usage' without threading.
(aside, as you are looking at it as' distributed among four threads, because the operating system, if you wish, then changed his mind, which is to run your program Such scheduling issues can not be altered in individual programs (and will not have a significant effect.)
Comments
Post a Comment