We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

program works in debug but not in release mode

madonion87
madonion87 asked
on
Medium Priority
313 Views
Last Modified: 2010-04-01
hi

i'm writing a program to read cpu details etc.
but the program will cause 100% cpu usage and not respond under release mode but in debug it works fine
you can find both version at
http://members.optusnet.com.au/madonion87/Debug.zip
http://members.optusnet.com.au/madonion87/Release.zip

someone already suggested that it might be the compiler optimization problem, i tried turning off optimization in MS VS.net 2003 but it doesnt help

any ideas would be very appreciated
Comment
Watch Question

Author

Commented:
this might help

"in the release build, after GetMessage is called, it goes on comparing whether the call has failed, and if not calls TranslateMessage and so on but the loop is very tight. whats more odd is the program never seems to pass control to windows, and forever looping and handling messages.

whereas in the debug build, after all messages are handled, program passes control to windows after a GetMessage call."

another guy i know in ocau forum said it, i'm not very sure what he means though
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
lol sorry

you can find the source code at http://members.optusnet.com.au/madonion87/muon.cpp

tell me if you need the header files
jkr
CERTIFIED EXPERT
Top Expert 2012

Commented:
>>you can find the source code at ...
>>tell me if you need the header files

Everything that you do not post here is pointless, as it renders the Q worthless for others. Sorry.
jkr
CERTIFIED EXPERT
Top Expert 2012
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
i've already looked at that site, tried turning off optimization as well, didnt help
thats why i want to see if anyone have also experienced the same problem, or know what might have caused it
jkr
CERTIFIED EXPERT
Top Expert 2012

Commented:
So, have you also tried to _DEBUG_ your release build then?

Commented:
When all else fails...

add print statements.

Author

Commented:
turning off aliasing fixed the problem
i think i will split the points into those who contributed, thanks
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.