Thread: [Dev-C++] Controlling Process Priority
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Scott W. <se...@al...> - 2002-11-13 17:41:00
Attachments:
winmail.dat
|
Hi, I'm building a Windows console application in C (my OS is Win2k and I have DevCpp 4.9.6.8). The application is computationally intensive so dominates CPU usage when run. By default, the program compiles to an executable with "Normal" priority and so leads to sluggish performance while running (typically several hours for each data set). I can, of course, manually set the priority to Low via the Win2K Task Manager but a) the setting resets to normal every time I launch another application and b) I'm lazy and would prefer to have the program run in low priority by default. So, I'm wondering if there's a way to compile the program to have "Low" priority from the get-go. I understand this could be purely an OS side-of-the-fence deal but thought I'd ask here in case it can be controlled from within DevCpp. Thanks. Scott |
|
From: Anders E. <am...@sw...> - 2002-11-13 20:26:18
|
Hello Scott, Wednesday, November 13, 2002, 6:41:39 PM, you wrote: SW> Hi, SW> I can, of course, manually set the priority to Low via the Win2K Task SW> Manager but a) the setting resets to normal every time I launch another SW> application and b) I'm lazy and would prefer to have the program run in low SW> priority by default. So, I'm wondering if there's a way to compile the SW> program to have "Low" priority from the get-go. Look up the Win32 API: SetPriorityClass -- Best regards, Anders mailto:am...@sw... |
|
From: Scott W. <se...@al...> - 2002-11-13 20:45:42
|
Thanks for the reply. This is probably naive but I've tried to find "Win32 API" in the DevCpp help and a C Library Reference Guide but to no avail. Is this in a header file? I found a w32api.h file but nothing there about SetPriorityClass. Scott -----Original Message----- From: Anders Eriksson [mailto:am...@sw...] Sent: Wednesday, November 13, 2002 3:11 PM To: dev...@li...; Scott Williams Cc: DevCpp UserList Subject: Re: [Dev-C++] Controlling Process Priority Hello Scott, Wednesday, November 13, 2002, 6:41:39 PM, you wrote: SW> Hi, SW> I can, of course, manually set the priority to Low via the Win2K Task SW> Manager but a) the setting resets to normal every time I launch another SW> application and b) I'm lazy and would prefer to have the program run in low SW> priority by default. So, I'm wondering if there's a way to compile the SW> program to have "Low" priority from the get-go. Look up the Win32 API: SetPriorityClass -- Best regards, Anders mailto:am...@sw... |
|
From: Anders E. <am...@sw...> - 2002-11-13 21:19:02
|
Hello Scott, Wednesday, November 13, 2002, 9:46:27 PM, you wrote: SW> Thanks for the reply. This is probably naive but I've tried to find "Win32 SW> API" in the DevCpp help and a C Library Reference Guide but to no avail. Is SW> this in a header file? I found a w32api.h file but nothing there about SW> SetPriorityClass. If you use the Tools - Check for Update/Packages, in Dev-Cpp. Press Start for vUpdate to check what's new. You will now get a list of all new modules and among them you will find help files for Dev-Cpp and a Win32 API reference. Select these, and press Download. If everything works then the Package Manager will start. You can now install the Win32 API reference (or maybe it will be automatically installed, can't remember). To Install a downloaded package you select Install ;-) You will now be asked for a package. The downloaded Pagages are in the Dev-Cpp\DevPaks directory. Select the Win32API.DevPak and Press Open and go through the installation wizard. When the installation finishes you will have a new submenu under Help - Win32.hlp The SetPriorityClass is in winbase.h/kernel32.lib so you need to add these to your project. The vUpdate server seems to be down at the moment, or maybe I have some error in my Internet connection .... -- Best regards, Anders mailto:am...@sw... |
|
From: Per W. <pw...@ia...> - 2002-11-13 22:05:00
|
SetThreadPriority is also a nice function to look at. /Per W On Wed, 13 Nov 2002, Anders Eriksson wrote: > Hello Scott, > > Wednesday, November 13, 2002, 9:46:27 PM, you wrote: > > SW> Thanks for the reply. This is probably naive but I've tried to find "Win32 > SW> API" in the DevCpp help and a C Library Reference Guide but to no avail. Is > SW> this in a header file? I found a w32api.h file but nothing there about > SW> SetPriorityClass. > > If you use the Tools - Check for Update/Packages, in Dev-Cpp. > > Press Start for vUpdate to check what's new. You will now get a list > of all new modules and among them you will find help files for Dev-Cpp > and a Win32 API reference. Select these, and press Download. If > everything works then the Package Manager will start. You can now > install the Win32 API reference (or maybe it will be automatically > installed, can't remember). > > To Install a downloaded package you select Install ;-) > You will now be asked for a package. The downloaded Pagages are in the > Dev-Cpp\DevPaks directory. Select the Win32API.DevPak and Press Open > and go through the installation wizard. When the installation finishes > you will have a new submenu under Help - Win32.hlp > > The SetPriorityClass is in winbase.h/kernel32.lib so you need to add > these to your project. > > The vUpdate server seems to be down at the moment, or maybe I have > some error in my Internet connection .... > > -- > Best regards, > Anders mailto:am...@sw... > > > > ------------------------------------------------------- > This sf.net email is sponsored by: Are you worried about > your web server security? Click here for a FREE Thawte > Apache SSL Guide and answer your Apache SSL security > needs: http://www.gothawte.com/rd523.html > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Per W. <pw...@ia...> - 2002-11-14 00:41:43
|
Who is the unlucky guy working at TFS Technology - or having an email address there? The mail below bounced back for improper Content Type. Since TFS Technology seems to specialize in secure messaging and Content Filtering, it seems a bit ridiculous that 'nice function to look at' is considered (insert suitable unmentionable word here). Since english isn't my native language - is there anyone else on the list who can find any words in the mail that should trigger content filtering? I didn't even find the word software :-) /Per W On Wed, 13 Nov 2002, Per Westermark wrote: > SetThreadPriority is also a nice function to look at. > > /Per W > > On Wed, 13 Nov 2002, Anders Eriksson wrote: > > > Hello Scott, > > > > Wednesday, November 13, 2002, 9:46:27 PM, you wrote: > > > > SW> Thanks for the reply. This is probably naive but I've tried to find "Win32 > > SW> API" in the DevCpp help and a C Library Reference Guide but to no avail. Is > > SW> this in a header file? I found a w32api.h file but nothing there about > > SW> SetPriorityClass. > > > > If you use the Tools - Check for Update/Packages, in Dev-Cpp. > > > > Press Start for vUpdate to check what's new. You will now get a list > > of all new modules and among them you will find help files for Dev-Cpp > > and a Win32 API reference. Select these, and press Download. If > > everything works then the Package Manager will start. You can now > > install the Win32 API reference (or maybe it will be automatically > > installed, can't remember). > > > > To Install a downloaded package you select Install ;-) > > You will now be asked for a package. The downloaded Pagages are in the > > Dev-Cpp\DevPaks directory. Select the Win32API.DevPak and Press Open > > and go through the installation wizard. When the installation finishes > > you will have a new submenu under Help - Win32.hlp > > > > The SetPriorityClass is in winbase.h/kernel32.lib so you need to add > > these to your project. > > > > The vUpdate server seems to be down at the moment, or maybe I have > > some error in my Internet connection .... > > > > -- > > Best regards, > > Anders mailto:am...@sw... > > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by: Are you worried about > > your web server security? Click here for a FREE Thawte > > Apache SSL Guide and answer your Apache SSL security > > needs: http://www.gothawte.com/rd523.html > > _______________________________________________ > > Dev-cpp-users mailing list > > Dev...@li... > > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by: Are you worried about > your web server security? Click here for a FREE Thawte > Apache SSL Guide and answer your Apache SSL security > needs: http://www.gothawte.com/rd523.html > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Scott W. <se...@al...> - 2002-11-13 22:08:21
|
Thanks. Don't I feel silly--didn't think about checking the DevPacks. I've glanced over the list on vUpdate from time to time but none seemed to apply to good ole basic number crunching type programming so I hadn't paid much heed. Forgot that Win API was on the list. Scott -----Original Message----- From: Anders Eriksson [mailto:am...@sw...] Sent: Wednesday, November 13, 2002 4:19 PM To: dev...@li...; Scott Williams Cc: DevCpp UserList Subject: Re[2]: [Dev-C++] Controlling Process Priority Hello Scott, Wednesday, November 13, 2002, 9:46:27 PM, you wrote: SW> Thanks for the reply. This is probably naive but I've tried to find "Win32 SW> API" in the DevCpp help and a C Library Reference Guide but to no avail. Is SW> this in a header file? I found a w32api.h file but nothing there about SW> SetPriorityClass. If you use the Tools - Check for Update/Packages, in Dev-Cpp. Press Start for vUpdate to check what's new. You will now get a list of all new modules and among them you will find help files for Dev-Cpp and a Win32 API reference. Select these, and press Download. If everything works then the Package Manager will start. You can now install the Win32 API reference (or maybe it will be automatically installed, can't remember). To Install a downloaded package you select Install ;-) You will now be asked for a package. The downloaded Pagages are in the Dev-Cpp\DevPaks directory. Select the Win32API.DevPak and Press Open and go through the installation wizard. When the installation finishes you will have a new submenu under Help - Win32.hlp The SetPriorityClass is in winbase.h/kernel32.lib so you need to add these to your project. The vUpdate server seems to be down at the moment, or maybe I have some error in my Internet connection .... -- Best regards, Anders mailto:am...@sw... |