0

Hi..
I have written a C++ program to compress and decompress jp2k files. But when I am executing this program the CPU usage is 100%... Can any one tell me :
why is it so and
how to reduce CPU usage?

I have compiled same code on windows and Linux platform But CPU usage is 100 % on linux and 50 % on Windows.

4
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by Salem
0

It's not a C++ issue, it's your operating system that doles out CPU time to the program. It sounds like yours is a pretty compute-intensive app, so it will take a lot of CPU time. Is your Linux/Windows disparity on the same machine (dual boot) or are you testing on two different boxes? Does the Windows box have a dual core processor?

0

Post the code here, we will have a look to see whether there is some optimization issue with your code.

0

It's not a C++ issue, it's your operating system that doles out CPU time to the program. It sounds like yours is a pretty compute-intensive app, so it will take a lot of CPU time. Is your Linux/Windows disparity on the same machine (dual boot) or are you testing on two different boxes? Does the Windows box have a dual core processor?

hi..
I am executing it on two different boxes. No Windows machine does not have dual core processor.
Thanx for your quick reply.. So can I reduce this CPU utlization by some way?

0

Well on Linux, you could use the nice() function to lower the priority of your process, so that it spends more time doing other things.

Windows has a similar feature, a search for 'Priority' through MSDN might prove useful.

This article has been dead for over six months. Start a new discussion instead.
Take the time to help us to help you. Please be thoughtful and detailed and be sure to adhere to our posting rules.