Solved

thread priority

Posted on 1998-11-19
8
237 Views
Last Modified: 2013-11-20
how can I change the priority that my program is running at?  I can't seem to find anything like ChangeThreadPriority.  thx
0
Comment
Question by:joshhsoj
  • 4
  • 2
  • 2
8 Comments
 
LVL 6

Expert Comment

by:thresher_shark
Comment Utility
I think the function you want is SetThreadPriority.  Does that do what you want?
0
 
LVL 2

Expert Comment

by:wyy_cq
Comment Utility
BOOL SetThreadPriority( HANDLE hThread,
 // handle to the thread
 int nPriority
 // thread priority level  );
hThread is the return value which is returned by CretateThread

nPriority can be one of these values:
THREAD_PRIORITY_ABOVE_NORMAL
 Indicates 1 point above normal priority for the priority class.
 
THREAD_PRIORITY_BELOW_NORMAL
 Indicates 1 point below normal priority for the priority class.
 
THREAD_PRIORITY_HIGHEST
 Indicates 2 points above normal priority for the priority class.
 
THREAD_PRIORITY_IDLE
 Indicates a base priority level of 1 for IDLE_PRIORITY_CLASS, NORMAL_PRIORITY_CLASS, or HIGH_PRIORITY_CLASS processes, and a base priority level of 16 for REALTIME_PRIORITY_CLASS processes.
 
THREAD_PRIORITY_LOWEST
 Indicates 2 points below normal priority for the priority class.
 
THREAD_PRIORITY_NORMAL
 Indicates normal priority for the priority class.
 
THREAD_PRIORITY_TIME_CRITICAL
 Indicates a base priority level of 15 for IDLE_PRIORITY_CLASS, NORMAL_PRIORITY_CLASS, or HIGH_PRIORITY_CLASS processes, and a base priority level of 31 for REALTIME_PRIORITY_CLASS processes.
 
if you want to set the process priority
you must set the proper priority when you create the process,
when the process is created, you only can change thread priority of the process.
the thread handle of process is returned when you create the process and put in the structure.
LPPROCESS_INFORMATION lpProcessInformation


0
 

Author Comment

by:joshhsoj
Comment Utility
directed at wyy_cq: your answer is a good one, but to be fare, i would like to award the pts to "threshar_shark"  how do i do that?
0
 
LVL 6

Expert Comment

by:thresher_shark
Comment Utility
josh - To open the question for someone else, reject the current proposed answer.  Then I can answer and you can give me a grade.  If you need any further help, please don't hesitate to ask.
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

by:joshhsoj
Comment Utility
ok
0
 
LVL 6

Accepted Solution

by:
thresher_shark earned 100 total points
Comment Utility
Okay, thanks, if you have any other questions, please feel free to ask.  Thanks!

wyy_cq - If you disagree with josh's decision to give me the points, please respond.
0
 
LVL 2

Expert Comment

by:wyy_cq
Comment Utility
TO : thresher_shark
my answer is not for point only.
Helping each other is the most important.


0
 
LVL 6

Expert Comment

by:thresher_shark
Comment Utility
Looks like josh accepted my answer anyway, I am glad you have that philosophy wyy_cq.  An unfortunate number of people are in it just for the points (which are essentially worthless).
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Get filename and folder into excel 7 67
if loop in java 3 114
while loop over for loop 7 79
move a line in eclipse 3 60
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now