Platform: Windows XP
Processor : Dual Core
I have a program written in C Language which is compiled and its exe is formed.
My question is that will the program use both the Cores (since my machine is dual core) or I have to make my program multithreaded in order to do it ?
You have to implement a multithreaded program when you want to use multiple cores.
There are plenty of threading libraries out there. I’d recommend you have a look into OpenMP website, which is quite easy to integrate and use for parallization.
EDIT: a simple example:
Normally you can parallelize your
forloops simply by adding:Of course, you have to link against OpenMP and compile with OpenMP support.