473,666 Members | 2,299 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.CurrentT hread.Priority. ToString();
Thread.CurrentT hread.Priority = System.Threadin g.ThreadPriorit y.BelowNormal;
sWrk2 = Thread.CurrentT hread.Priority. ToString();

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

Thanks!

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

"Norm" <No**@discussio ns.microsoft.co m> wrote in message
news:A9******** *************** ***********@mic rosoft.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.CurrentT hread.Priority. ToString();
Thread.CurrentT hread.Priority =
System.Threadin g.ThreadPriorit y.BelowNormal;
sWrk2 = Thread.CurrentT hread.Priority. ToString();

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

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.GetCurr entProcess().Pr iorityClass = ProcessPriority Class.BelowNorm al
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 priority, I can keep the computer running ok, or at least recover. So that's what my program does - keeps itself and those programs with high enough priority. It works great when run from visual studio, but as soon as i run it directly (whether in...
77
4576
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 process starts is not especially important, but it must be complete within a small number of seconds. The operations I am performing do not take a long time (hundreds of milliseconds), but as each part of the process is complete, my worker thread...
4
4212
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 Manager" and look at my process it still has a "Base Pri" of "Normal". What thing am I missing? C# Code snippet:
4
15947
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, I'd like to be notified. I tried few combinations of Close, Closing, Application.Exit method, ApplicationExit Event, etc, but nothing seems to be working. Thanks in advance Strah@Langan
5
1524
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 service creates the report. My question is if a user cancels or closes the browser before the report is completed, but windows service is still in the process of creating a report how do I notify the service to quit creating a report because...
6
1652
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 interact with excel and everything works fine as I monitor interactions with my hidden excel sheet. The problem comes if a user opens another instance of excel. Is there any way that I can use the process classes or another means to increase...
0
8443
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8356
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8781
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8550
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4366
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2769
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 we have to send another system
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1772
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.