473,668 Members | 2,446 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Setting thread priority to low(est)

I have a couple of small single-thread Console utilities doing cpu-intensive
stuff. Is there an easy way to set the program execution priority to LOW
from within the program ? Now I pause the things first and invoke
TaskManager and manually set the priority... A bit cumbersome.
Nov 15 '05 #1
3 6948
MJB
I don't think there is. You may want to execute the worker code in a
separate thread; that way you can control the priority. Good luck.
"Stu Banter" <x2************ **@westerterp.c om> wrote in message
news:3f******** *************** @news.xs4all.nl ...
I have a couple of small single-thread Console utilities doing cpu-intensive stuff. Is there an easy way to set the program execution priority to LOW
from within the program ? Now I pause the things first and invoke
TaskManager and manually set the priority... A bit cumbersome.

Nov 15 '05 #2
Use the Process class to GetCurrentProce ss. Then use that process's
public property PriorityClass to set the priority of the process.

"Stu Banter" <x2************ **@westerterp.c om> wrote in message
news:3f******** *************** @news.xs4all.nl ...
I have a couple of small single-thread Console utilities doing cpu-intensive stuff. Is there an easy way to set the program execution priority to LOW
from within the program ? Now I pause the things first and invoke
TaskManager and manually set the priority... A bit cumbersome.

Nov 15 '05 #3
Hi,

Take a look at Process class, here you have a PriorityClass property that
you may use for it.

Also try this line:
Thread.CurrentT hread.Priority = ThreadPriority. BelowNormal;
Hope this help,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Stu Banter" <x2************ **@westerterp.c om> wrote in message
news:3f******** *************** @news.xs4all.nl ...
I have a couple of small single-thread Console utilities doing cpu-intensive stuff. Is there an easy way to set the program execution priority to LOW
from within the program ? Now I pause the things first and invoke
TaskManager and manually set the priority... A bit cumbersome.

Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
2887
by: John | last post by:
Hello. If I want to set up my first database and start using it in Dreamweaver what do I need to do? The book I'm working on has a CD with the database on. It is telling me to put it in the MySql folder on drive C. However, when I'm in Dreamweaver I click on Applications at the side, and the plus button to add a MySql database. It tells me to enter the
3
1662
by: John | last post by:
I have a package built in C#.Net. I have the deployment package all set. However, I have a file that needs to be installed in the project but I don't want it be overwritten by an older version of the file if a user updates it before another user runs the install. i.e.. Customer 1 installs to a network drive k Customer 1 updates file X.xml Customer 2 also installs to a network drive k (same network) Customer 2 needs the updates that...
12
3079
by: Eric Lindsay | last post by:
I'm trying to learn how to read a DTD I wanted to use, http://www.w3.org/TR/html4/strict.dtd to ensure I was treating each element correctly in terms of being block, inline, or flow (either). <!ENTITY % block "P | %heading; | %list; | %preformatted; | DL | DIV | NOSCRIPT | BLOCKQUOTE | FORM | HR | TABLE | FIELDSET | ADDRESS"> <!ENTITY % flow "%block; | %inline;">
3
4995
by: Olivier BESSON | last post by:
Hello, I have a web service of my own on a server (vb.net). I must declare it with SoapRpcMethod to be used with JAVA. This is a simple exemple method of my vb source : >************************************************************************ > <WebMethod(), System.Web.Services.Protocols.SoapRpcMethod()> _ > Public Function HelloWorld() As > <System.Xml.Serialization.SoapElementAttribute("return")> String
1
1834
by: dbee | last post by:
So I can't figure out what exactly is going wrong here ... I'm using php4.3 I'm accessing a server in Dublin from Seoul. I need to be able to translate times into various timezones across the world. Simple addition isn't the best because it doesn't take into account Daylight Saving Times etc .... What I'm doing is setting the TZ environment variable to my preferred timezone and then calling a date function to get the hour ...
5
4602
by: gesres | last post by:
I have some column headings whose widths are set via styles: <TR> <TD style="visibility:hidden;width:0px">&nbsp;</TD> <TD style="visibility:hidden;width:0px">&nbsp;</TD> <TD style="visibility:hidden;width:0px">&nbsp;</TD> <TD class="head1" style="WIDTH: 120px">Stage</TD> <TD class="head1" style="WIDTH: 90px">Est. Hours</TD> <TD class="head1" style="WIDTH: 90px">Est. Delivery</TD> <TD class="head1" style="WIDTH: 90px">Est. Cost</TD>
0
3208
by: helloitsme | last post by:
Hello All! I know there already exists a thread with this topic by Mike! But my problem did not get solved with that.... I have a working code in VB6 that can set the selected timezone for the system. When i converted that code in VB .NET, I am having a problem similar to what Mike was having. When I select my timezone to Eastern Time Zone (or SA Pacific), my code sets my system timezone to 'Bogota, Lima, Quito'. i guess it is becoz both...
3
2926
by: =?Utf-8?B?UGhpbCBKb2huc29u?= | last post by:
Hi, I have a web application that will be hosted on servers with timezones configured to EST with daylight saving. My application takes an XML datafeed that contains times in GMT (also with daylight saving that will change on different dates to EST) Is there any way within the .net framework to convert the current time from the server (which will be EST with daylight saving) to GMT?
44
7784
by: climber.cui | last post by:
Hi all, Does anyone have experience on the thread-safty issue with malloc()? Some people said this function provided in stdlib.h is not thread- safe, but someone said it is thread safe. Is it possible this function evolves from thread-unsafe to thread-safe in recent years? How could i find out? I am using the C library coming with GNU linux distribution. thanks a lot.
0
8371
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8889
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8790
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8572
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7391
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6206
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5677
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2782
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.