473,507 Members | 6,727 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5001

"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
373
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
4503
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
4197
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
601
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
15882
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
1514
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
1633
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
7109
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
7313
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,...
0
7372
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
7481
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5619
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,...
1
5039
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
4702
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...
0
1537
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 ...
0
411
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.