Special

Clearance Sale!

We've been publishing for over five years now and it's time to clear out our inventory of back issues, so we're slashing prices!

RBD Magazines

Check out this amazing clearance sale of all our past issues. Missing some issues? This is a great time to complete your RBD collection. Save up to 40% off the regular price of our printed back issue packages. These prices are only good until the end of the year May 2008 and supplies are limited, so place your order today.

Article Preview


Buy Now

Print:
PDF:

Intel corner

Process Priority

Change the priority of your process

Issue: 4.5 (May/June 2006)
Author: Christian Schmitz, cSchmitz-at-rbdeveloper.com
Article Description: No description available.
Article Length (in bytes): 5,796
Starting Page Number: 42
RBD Number: 4516
Resource File(s):

Download Icon 4516.sit Updated: Monday, May 15, 2006 at 4:53 PM
Download Icon 4516.zip Updated: Monday, May 15, 2006 at 4:53 PM

Related Link(s): None
Known Limitations: None

Excerpt of article text...

Windows is a multitasking operation system, but sometimes you want to have all CPU power doing a certain task. For example you do a measurement and nothing else is running on that PC. Your application can process thousands of values for you, doing the job fast enough.

But then someone clicks on the screen -- in the task bar, for example -- and something is loaded, a window opens, and your application loses some values as the processing goes slower. For a second your application is only getting 10% of the CPU's attention; this can hurt your results if you do real time measurements.

A way to help here is to use process priorities to give your process the CPU nearly exclusively. Of course you'll still have the clocks in the background, but no virus scanner or print spooler -- and a click to the start menu won't slow down your application too much.

Find current process handle

The first step on the way to control priorities is to find a handle to our current process. You can find all the code embedded inside the example project, including the GetCurrentProcess method:

...End of Excerpt. Please purchase the magazine to read the full article.

Article copyrighted by REALbasic Developer magazine. All rights reserved.


 


|

 


Weblog Commenting and Trackback by HaloScan.com