469,946 Members | 1,771 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,946 developers. It's quick & easy.

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 4775

"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.

Similar topics

77 posts views Thread by Charles Law | last post: by
4 posts views Thread by Harry J. Smith | last post: by
5 posts views Thread by Peter | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.