On Tue, 13 May 2008 09:44:06 -0700, Victory <cs****@devdex.comwrote:
Do i need to use a special class if i need to code on computer with
multiple processors. I need to make sure that all of the CPU resources
are used to process the code. Is there a way to do this?
That depends on what you mean. If you have only one thread in your
application, then you will only use one CPU.
If you have multiple threads, you will use at most as many CPUs as you
have threads. The OS will ensure that, if a CPU is available and you have
a thread that's runnable (that is, it's not waiting on something), the
thread will run. So generally speaking, the answer is: just make sure you
have enough threads ready to run to keep all the CPUs busy.
In practice, it can get very complicated, depending on your application,
but then you haven't really offered any details to allow a better answer.
Hopefully the above is enough to get you started.
Pete