| delorie.com/archives/browse.cgi | search |
| Mailing-List: | contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm |
| List-Subscribe: | <mailto:cygwin-subscribe AT sources DOT redhat DOT com> |
| List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT sources DOT redhat DOT com> |
| List-Help: | <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs> |
| Sender: | cygwin-owner AT sources DOT redhat DOT com |
| Delivered-To: | mailing list cygwin AT sources DOT redhat DOT com |
| Date: | Thu, 21 Jun 2001 19:50:46 +0300 |
| Message-Id: | <200106211650.TAA22309@linux.> |
| From: | "Ehud Karni" <ehud AT unix DOT simonwiesel DOT co DOT il> |
| To: | "Brian Michael Genisio" <genisiob AT pilot DOT msu DOT edu> |
| Subject: | Re: set priority? |
| CC: | cygwin AT cygwin DOT 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 AT unix DOT simonwiesel DOT co DOT il |
| References: | <200106201945 DOT f5KJjhZ44108 AT pilot19 DOT cl DOT msu DOT edu> |
| X-Mailer: | Emacs 20.7.1 rmail (send-msg 1.104) |
| MIME-Version: | 1.0 |
On Wed, 20 Jun 2001 15:45:43 -0400 (EDT), Brian Michael Genisio <genisiob AT pilot DOT msu DOT 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 AT unix DOT simonwiesel DOT co DOT il http://www.simonwiesel.co.il
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |