Search   Articles   Dev Forums   Personalize   Favorites   Member Login   ASP.Net Hosting
DevASP.NET for ASP.NET, VB.NET, XML and C# (C-Sharp) Developers Wednesday, January 07, 2009

Dev Articles
Search Directory
ASP.NET
VB.Net
C-Sharp
SQL Server
 
FREE 12 month online training for ASP.NET & MS Expression Studio and a Free copy of MS Expression Web with Windows Server Purchase

User Rating!

Home > Search > Articles & Samples > Visual C++ .NET > Threading
Better way to Sleep: Control execution and Limit CPU usage by your threads        
Total Hits: 25  |  Today: 0 Author: Lone Developer       Rating:  
Read Reviews | Write Review |   Your Rating: 

I had a code that consist of a thread that was heavily CPU intensive. And i need to limit it's execution so that it's CPU usage should not go above a particular limit, irrespective of the hardware/processor over which the program was running. Moreover we often come across a problem, in which we need to Sleep() a thread for a particular duration of time. Such kind of code often consist of a loop, doing some kind of processing/repetitive polling and sleeping at the end of loop for some time, to save CPU cycles. This goes on and on until the loop is terminated.

DevASP.Net users Rating
What is your opinion?
Is this your listing?

    If this is your listing and you like to add the rating box
    displayed on the right side on your site you can use the following code.

Go Back
DevASP.Net - Disclaimer - Privacy
Copyright © 2008 DevASP.net