473,385 Members | 2,004 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,385 software developers and data experts.

Process priority change not showing up in Windows Task Manager

I have a program that is cpu intensive so I want to change it's priority to
BelowNormal. The code functions without error, the VS Debugger shows the
change but when I then go to "Windows Task Manager" and look at my process it
still has a "Base Pri" of "Normal".

What thing am I missing?
C# Code snippet:

sWrk1 = Thread.CurrentThread.Priority.ToString();
Thread.CurrentThread.Priority = System.Threading.ThreadPriority.BelowNormal;
sWrk2 = Thread.CurrentThread.Priority.ToString();

At this point VS Debugger reports sWrk1 is "Normal" and sWrk2 is
"BelowNormal".

Thanks!

--
Norm H
Jul 21 '05 #1
1 4994

"Norm" <No**@discussions.microsoft.com> wrote in message
news:A9**********************************@microsof t.com...
I have a program that is cpu intensive so I want to change it's priority to
BelowNormal. The code functions without error, the VS Debugger shows the
change but when I then go to "Windows Task Manager" and look at my process
it
still has a "Base Pri" of "Normal".

What thing am I missing?
C# Code snippet:

sWrk1 = Thread.CurrentThread.Priority.ToString();
Thread.CurrentThread.Priority =
System.Threading.ThreadPriority.BelowNormal;
sWrk2 = Thread.CurrentThread.Priority.ToString();

At this point VS Debugger reports sWrk1 is "Normal" and sWrk2 is
"BelowNormal".

Thanks!


You are not changing the processes priority, you are changing the threads
priority.

you need to set the PriorityClass property on the Process object of your
process, like so

Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.BelowNormal
Jul 21 '05 #2

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

Similar topics

0
by: wtfhits | last post by:
I'm writing my own task manager as I often change process priorities but have gotten myself into trouble on several occasions. I have discovered by keeping csrss.exe and explorer at the equal highest...
77
by: Charles Law | last post by:
Hi guys I have a time critical process, running on a worker thread. By "time critical", I mean that certain parts of the process must be completed in a specific time frame. The time when the...
4
by: Harry J. Smith | last post by:
How can a program change its execution priority in the operating system while it is running? -Harry
1
by: Norm | last post by:
I have a program that is cpu intensive so I want to change it's priority to BelowNormal. The code functions without error, the VS Debugger shows the change but when I then go to "Windows Task...
4
by: Strah | last post by:
Is there a way to catch the event of terminating the application from the the processes tab in task manager? I have created windows app, and if a user termintates the app in the task manager,...
5
by: Peter | last post by:
I have a webpage which creates reports, a report can take few seconds or several minutes to create. This webpage calls a web service which in turn does a remoting call to a windows service and the...
6
by: Bob | last post by:
Hi, I have an application that uses a excel in conjuction with a third party application. I create an excel instance in c# and mark it as invisible. The third party application is programmed to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...

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.