Special

Special Print Closeout!

We're clearing out the remainder of our print issues at fire sale prices -- as much as 75% off! Quantities are extremely limited and only available while supplies last. Hurry to take advantage of this one-time offer.

RBD Magazines

Once these printed back issues are gone, they are gone!

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