Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
Date: Thu, 21 Jun 2001 19:50:46 +0300
Message-Id: <200106211650.TAA22309@linux.>
From: "Ehud Karni" <ehud@unix.simonwiesel.co.il>
To: "Brian Michael Genisio" <genisiob@pilot.msu.edu>
Subject: Re: set priority?
CC: cygwin@cygwin.com
In-reply-to: <200106201945.f5KJjhZ44108@pilot19.cl.msu.edu> (message from
	Brian Michael Genisio on Wed, 20 Jun 2001 15:45:43 -0400 (EDT))
Organization: Simon & Wiesel Insurance agency
Reply-to: ehud@unix.simonwiesel.co.il
References:  <200106201945.f5KJjhZ44108@pilot19.cl.msu.edu>
X-Mailer: Emacs 20.7.1 rmail (send-msg 1.104)
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-8
Content-Transfer-Encoding: 7bit

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

