Search code examples
cwindows-7multicore

How to use all the cores in Windows 7?


I am not sure if this belongs to Stackoverflow or Superuser but I thought I would ask here.

I have a console based application written in C which currently takes about an hour to terminate in Windows 7 64-bit OS. The task manager reports that the application is using only 25% of the available CPU. I would like to reduce the run time by increasing cpu usage.

Is there any way to let the application use all four cores (the laptop has Core i5) instead of just one? I am assuming that task manager reports 25% because only one core is allocated to the program.


Solution

  • Without re-writing the app to be multi=threaded no, you can't change the behavior of the app. The only thing that you might can do, is if the app can process ranges of input data, then you can launch 4 instances of the app with different ranges of input data to process and the combine the results after they are all done.

    Imagine rendering a 3D animation and the renderer is single threaded, but you can specify start and end frames. You have 100 frames to render you would start 4 instances, and specify start and end frame ranges 0 - 25, 26 - 50, 51 - 75, 76 - 100. Then you would combine all the outputs to your final movie file.