C++ MFC

Moderators: Lundin
Number of threads: 3354
Number of posts: 9032

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Loops per second of thread suddenly drops Posted by GrayFox1978 on 31 Mar 2010 at 3:35 PM
I'm writing a program that copies the bitmap of the desktop (like a screenshot), calculates the average RGB value of the screen, and send it over USB.
Everything is working and I manage to get 30+ loops per second, which is good enough.

However, after some time (varying between ~20 sec and ~1 min 30 sec), and not doing anything else, the loops per second suddenly drop to about 10 loops per second, which is too slow for my purpose. This transition happens within a fraction of a second.

When I watch the Task Manager, and don't see anything special happening. The CPU time for my process remains the same, the total CPU usage is quite stable, memory usage is stable as well.

I've tried changing Thread priority and Process priority but nothing seems to work. I am at a loss here.

Anyone has any ideas? I would greatly appreciate any suggestions, advice and thoughts.
Report
Re: Loops per second of thread suddenly drops Posted by GrayFox1978 on 1 Apr 2010 at 1:29 PM
I found the problem,
it seems my processor, which is an Intel, slows down sometimes for some crazy reason.
This happened at the exact same time my program slowed down as well...
Report
Re: Loops per second of thread suddenly drops Posted by AsmGuru62 on 2 Apr 2010 at 7:08 AM
This is not really finding the "real" reason, is it?
How can you prove that CPU slows down for some crazy reason?
Report
Re: Loops per second of thread suddenly drops Posted by anthrax11 on 2 Apr 2010 at 9:47 AM
It might be CPU throttling trying to keep the temperature down. This can be disabled in the BIOS.
Report
Re: Loops per second of thread suddenly drops Posted by GrayFox1978 on 2 Apr 2010 at 10:01 AM
It's called Speed Step. Notebooks to this to save battery life. However, my notebook does it even if I'm plugged in and on high performance profile.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.