Hi,
As I've created the application that is hard on calculations -> lots of work to do, not very complex calculations -> it takes too long to work it out and the process is only at 45% of the CPU. Can I maximize it somehow?: to go to 90%?
Hi,
As I've created the application that is hard on calculations -> lots of work to do, not very complex calculations -> it takes too long to work it out and the process is only at 45% of the CPU. Can I maximize it somehow?: to go to 90%?
If you have a dual core machine (which I'm guessing you do), the most you could hope to get in a single thread would be 50% CPU usage.
To get 90% CPU usage, you will most likely need to thread your calculations. This may be very simple, or very difficult, depending on the nature of the algorithm you want to thread.
If you can break up your working set into multiple groups, I would recommend considering using the ThreadPool, or potentially even the Task Parallel Library, depending on your timing for release.
More than likely you have a dual core CPU, and if your app is single threaded, the maximum CPU it will use is 50% (all of one core). In order to get better use, you need to utilize multiple threads, but that also means figuring out some way to break your calculations into pieces so that they can be worked on by more than one core.
If you just have a simple loop doing the calculations, then most likely your computer has two cores/processors. A single threaded application will at best use 50% of the CPU.
You need multiple threads to use the whole CPU on a multi-core machine.
Check this: