473,408 Members | 1,982 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Writing a low-priority program

I'm looking to write a program that operates at the lowest execution
priority possible. That is, I want the program to basically run in the
background having as little impact on the performance of computer system as
possible. The program will do some background backup tasks.

I'm reasonably sure that the first step is to create a thread, and to assign
the thread the lowest execution priority possible. Are there any other
techniques, advice, tricks, etc. that I should be aware of? Are there any
good examples or tutorials that anyone knows of?

TIA,

Richard Rosenheim
Jul 21 '05 #1
5 1895
Just run your process with the ProcessPriorityClass.Idle.

Willy.

"Richard L Rosenheim" <ri*****@rlr.com> wrote in message
news:e2*************@TK2MSFTNGP10.phx.gbl...
I'm looking to write a program that operates at the lowest execution
priority possible. That is, I want the program to basically run in the
background having as little impact on the performance of computer system
as
possible. The program will do some background backup tasks.

I'm reasonably sure that the first step is to create a thread, and to
assign
the thread the lowest execution priority possible. Are there any other
techniques, advice, tricks, etc. that I should be aware of? Are there any
good examples or tutorials that anyone knows of?

TIA,

Richard Rosenheim

Jul 21 '05 #2
Thanks for the reply. One other question -- is it possible (or even
advisable) to set the priority of the actual program to idle, or must/should
I spawn a separate thread in which I set that thread's priority to idle?

Richard Rosenheim
"Willy Denoyette [MVP]" <wi*************@pandora.be> wrote in message
news:O8**************@TK2MSFTNGP11.phx.gbl...
Just run your process with the ProcessPriorityClass.Idle.

Willy.

"Richard L Rosenheim" <ri*****@rlr.com> wrote in message
news:e2*************@TK2MSFTNGP10.phx.gbl...
I'm looking to write a program that operates at the lowest execution
priority possible. That is, I want the program to basically run in the
background having as little impact on the performance of computer system
as
possible. The program will do some background backup tasks.

I'm reasonably sure that the first step is to create a thread, and to
assign
the thread the lowest execution priority possible. Are there any other
techniques, advice, tricks, etc. that I should be aware of? Are there any good examples or tutorials that anyone knows of?

TIA,

Richard Rosenheim


Jul 21 '05 #3
Richard,
No, just grap the CurrentProcess and set it's prioryty class to Idle.

....
Process currentProcess = Process.GetCurrentProcess();
currentProcess.PriorityClass = ProcessPriorityClass.Idle;
....

Willy.

"Richard L Rosenheim" <ri*****@rlr.com> wrote in message
news:OI**************@TK2MSFTNGP12.phx.gbl...
Thanks for the reply. One other question -- is it possible (or even
advisable) to set the priority of the actual program to idle, or
must/should
I spawn a separate thread in which I set that thread's priority to idle?

Richard Rosenheim
"Willy Denoyette [MVP]" <wi*************@pandora.be> wrote in message
news:O8**************@TK2MSFTNGP11.phx.gbl...
Just run your process with the ProcessPriorityClass.Idle.

Willy.

"Richard L Rosenheim" <ri*****@rlr.com> wrote in message
news:e2*************@TK2MSFTNGP10.phx.gbl...
> I'm looking to write a program that operates at the lowest execution
> priority possible. That is, I want the program to basically run in the
> background having as little impact on the performance of computer
> system
> as
> possible. The program will do some background backup tasks.
>
> I'm reasonably sure that the first step is to create a thread, and to
> assign
> the thread the lowest execution priority possible. Are there any other
> techniques, advice, tricks, etc. that I should be aware of? Are there any > good examples or tutorials that anyone knows of?
>
> TIA,
>
> Richard Rosenheim
>
>



Jul 21 '05 #4
Thanks again.

Richard Rosenheim
"Willy Denoyette [MVP]" <wi*************@pandora.be> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Richard,
No, just grap the CurrentProcess and set it's prioryty class to Idle.

...
Process currentProcess = Process.GetCurrentProcess();
currentProcess.PriorityClass = ProcessPriorityClass.Idle;
...

Willy.

"Richard L Rosenheim" <ri*****@rlr.com> wrote in message
news:OI**************@TK2MSFTNGP12.phx.gbl...
Thanks for the reply. One other question -- is it possible (or even
advisable) to set the priority of the actual program to idle, or
must/should
I spawn a separate thread in which I set that thread's priority to idle?

Richard Rosenheim
"Willy Denoyette [MVP]" <wi*************@pandora.be> wrote in message
news:O8**************@TK2MSFTNGP11.phx.gbl...
Just run your process with the ProcessPriorityClass.Idle.

Willy.

"Richard L Rosenheim" <ri*****@rlr.com> wrote in message
news:e2*************@TK2MSFTNGP10.phx.gbl...
> I'm looking to write a program that operates at the lowest execution
> priority possible. That is, I want the program to basically run in the > background having as little impact on the performance of computer
> system
> as
> possible. The program will do some background backup tasks.
>
> I'm reasonably sure that the first step is to create a thread, and to
> assign
> the thread the lowest execution priority possible. Are there any other > techniques, advice, tricks, etc. that I should be aware of? Are
there any
> good examples or tutorials that anyone knows of?
>
> TIA,
>
> Richard Rosenheim
>
>



Jul 21 '05 #5
Cor
Priority setting for your current program mainthread

Threading.Thread.CurrentThread.Priority = Threading.ThreadPriority.Lowest

I hope this helps?

Cor
Jul 21 '05 #6

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

Similar topics

5
by: mark1822 | last post by:
Hi, I am trying to figure out if I should learn C and C++ to write CGI programs, or if I should just use PHP for my web site. I want to write a high traffic website that would call executibles...
385
by: Xah Lee | last post by:
Jargons of Info Tech industry (A Love of Jargons) Xah Lee, 2002 Feb People in the computing field like to spur the use of spurious jargons. The less educated they are, the more they like...
16
by: Sohail | last post by:
Hi all, i am now to group this might be out of topic, if it is then please tell me where i should ask this question... At the time i am working on a project based on 8051, The project is so get...
13
by: jay.dow | last post by:
I want to write to the pins of an RS232 without using the serial protocol. The use would be every pin could act to complete a circuit in customized hardware. I could use python to communicate...
102
by: Xah Lee | last post by:
i had the pleasure to read the PHP's manual today. http://www.php.net/manual/en/ although Pretty Home Page is another criminal hack of the unix lineage, but if we are here to judge the quality...
4
by: John Pote | last post by:
Hello, help/advice appreciated. Background: I am writing some web scripts in python to receive small amounts of data from remote sensors and store the data in a file. 50 to 100 bytes every 5 or...
19
by: Marco | last post by:
FYI: Guidelines for writing efficient C/C++ code http://www.embedded.com/showArticle.jhtml?articleID=184417272 any comments?
8
by: maxvalery | last post by:
Hi, Here's a worthy challenge for ya'll. I'm trying to build a questionnaire in php and need help understanding the logic behind the process. Here's an example that explains everything: 1)...
7
by: Matt Kowalczyk | last post by:
Hello, I am working on a compression project and I want to write ASCII characters using the minimum amount of bits. Since I will be writing ASCII characters from 0-127 I only need 7 bits to...
19
by: rmr531 | last post by:
First of all I am very new to c++ so please bear with me. I am trying to create a program that keeps an inventory of items. I am trying to use a struct to store a product name, purchase price,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...
0
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,...
0
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...
0
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...

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.