Article Preview
Buy Now
COLUMN
Process Priority
Change the priority of your process
Issue: 4.5 (May/June 2006)
Author: Christian Schmitz
Author Bio: Christian Schmitz is the creator of the Monkeybread Software REALbasic Plugins.
Article Description: No description available.
Article Length (in bytes): 6,840
Starting Page Number: 42
Article Number: 4516
Resource File(s):
4516.zip Updated: 2013-03-11 19:07:59
Related Link(s): 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.