By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,995 Members | 1,195 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,995 IT Pros & Developers. It's quick & easy.

Process priority change not showing up in Windows Task Manager

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a

"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 discussion thread is closed

Replies have been disabled for this discussion.