c++ - Program not using all of CPU? -


this question has answer here:

i wrote simple program in c++ like:

while(1){var+=1;var-=1;}  

and ran it, seems use 25% of cpu.

how can increase amount of cpu program use, 95%?

sounds you're running on 4-processor system. are using 100% of cpu on 1 core. use other cores, have write multi-thread version of application.

multi-threading complicated, there lots of tutorials out there; hit google. luck!


Comments

Popular posts from this blog

Prolog - Listing -

python - can't seem to get an output from my class -

orchardcms - change base url in local copy in Orchard CMS -