This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: set priority?
- To: "Brian Michael Genisio" <genisiob at pilot dot msu dot edu>
- Subject: Re: set priority?
- From: "Ehud Karni" <ehud at unix dot simonwiesel dot co dot il>
- Date: Thu, 21 Jun 2001 19:50:46 +0300
- CC: cygwin at cygwin dot com
- Organization: Simon & Wiesel Insurance agency
- References: <200106201945.f5KJjhZ44108@pilot19.cl.msu.edu>
- Reply-to: ehud at unix dot simonwiesel dot co dot il
On Wed, 20 Jun 2001 15:45:43 -0400 (EDT), Brian Michael Genisio <genisiob@pilot.msu.edu> wrote:
>
> Is there a way through a cygwin tool to set the priority from normal to high or
> real in Windows? I can do it through a shareware program, and it increases the
> efficiency of my app, but I want to do it in a script. Any Ideas?
Yes. Here is a sample code that does it (tested).
#include <windows.h> /* for some specific Windoz calls */
{
HANDLE WinId ;
WinId = GetCurrentProcess ( ) ; /* get my Windows HANDLE */
SetPriorityClass ( WinId , REALTIME_PRIORITY_CLASS ) ; /* set priority to REAL TIME CLASS */
}
The 4 defined priority classes are: NORMAL_PRIORITY_CLASS,
IDLE_PRIORITY_CLASS, HIGH_PRIORITY_CLASS, REALTIME_PRIORITY_CLASS.
Note. The include is from an old program, it might have changed to
<w32api/windows.h>, I did not compile it lately, and I can't do it here.
Ehud.
--
Ehud Karni Mivtach - Simon Insurance /"\
Tel: +972-3-6212-757 Fax: +972-3-6292-544 \ / ASCII Ribbon Campaign
(USA) Fax and voice mail: 1-815-5509341 X Against HTML Mail
Better Safe Than Sorry / \
mailto:ehud@unix.simonwiesel.co.il http://www.simonwiesel.co.il
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple