[RC5] WinNT Priority

Oliver von Bueren ovb at ovb.ch
Thu Jan 8 09:42:26 EST 1998


On Wed, 07 Jan 98 23:54:23 +1300, you wrote:

>Im wanting to put the winNT service edition on a PPro200 Lotus Notes
>server here, but i noticed it has a backup agent that also runs at Low
>priority, and i don't want to stuff up the backup process.

Don't know which one it was, but there are some tools around. Go check
the WinNT specific sites.

>So how do i find the full priority of threads under winNT (or does NT
>really have only 4 priorities)?
Not quite. There are "sub-levels", which realy gives it a 31 levels.
(Wonder what level 0 would be?:-)) Here the description from the api
SetPriorityClass :

---<CUT>---
The SetPriorityClass function sets the priority class for the
specified process. This value together with the priority value of each

thread of the process determines each thread's base priority level. 

[... cut ...]
Remarks

Every thread has a base priority level determined by the thread's
priority value and the priority class of its process. The system uses
the base priority level of all executable threads to determine which
thread gets the next slice of CPU time. Threads are scheduled in a
round-robin fashion at each priority level, and only when there are no
executable threads at a higher level will scheduling of threads at a
lower level take place. 
The base priority level of a thread is in the range 1 through 31.
Following are the normal base priority levels for each priority class:

Class	Normal base priority
HIGH_PRIORITY_CLASS	13
IDLE_PRIORITY_CLASS	4
NORMAL_PRIORITY_CLASS	9 if the window of the process is in the
			  foreground; and 7 if the window is in the
			  background
REALTIME_PRIORITY_CLASS	24
 
The SetThreadPriority function enables setting the base priority level
of a thread relative to the priority class of its process. For
example, specifying THREAD_PRIORITY_HIGHEST in a call to
SetThreadPriority for a thread of an IDLE_PRIORITY_CLASS process sets
the thread's base priority level to 6. 
[... cut ...]

The following table shows the base priority levels for each
combination of priority class and thread priority value. Note that for
IDLE_PRIORITY_CLASS, NORMAL_PRIORITY_CLASS, and HIGH_PRIORITY_CLASS,
this base level can receive dynamic boosts. 
Base	Priority class/thread priority
1	Idle, normal, or high class, THREAD_PRIORITY_IDLE
2	Idle class, THREAD_PRIORITY_LOWEST
3	Idle class, THREAD_PRIORITY_BELOW_NORMAL
4	Idle class, THREAD_PRIORITY_NORMAL
5	Background normal class, THREAD_PRIORITY_LOWEST 
	Idle class, THREAD_PRIORITY_ABOVE_NORMAL
6	Background normal class, THREAD_PRIORITY_BELOW_NORMAL
	Idle class, THREAD_PRIORITY_HIGHEST
7	Foreground normal class, THREAD_PRIORITY_LOWEST
	Background normal class, THREAD_PRIORITY_NORMAL
8	Foreground normal class, THREAD_PRIORITY_BELOW_NORMAL
	Background normal class, THREAD_PRIORITY_ABOVE_NORMAL
9	Foreground normal class, THREAD_PRIORITY_NORMAL
	Background normal class, THREAD_PRIORITY_HIGHEST
10	Foreground normal class, THREAD_PRIORITY_ABOVE_NORMAL
11	High class, THREAD_PRIORITY_LOWEST
	Foreground normal class, THREAD_PRIORITY_HIGHEST
12	High class, THREAD_PRIORITY_BELOW_NORMAL
13	High class, THREAD_PRIORITY_NORMAL
14	High class, THREAD_PRIORITY_ABOVE_NORMAL
15	Idle, normal, or high class, THREAD_PRIORITY_TIME_CRITICAL 
	High class, THREAD_PRIORITY_HIGHEST
16	Real-time class, THREAD_PRIORITY_IDLE
22	Real-time class, THREAD_PRIORITY_LOWEST
23	Real-time class, THREAD_PRIORITY_BELOW_NORMAL
24	Real-time class, THREAD_PRIORITY_NORMAL
25	Real-time class, THREAD_PRIORITY_ABOVE_NORMAL
26	Real-time class, THREAD_PRIORITY_HIGHEST
31	Real-time class, THREAD_PRIORITY_TIME_CRITICAL
---<CUT>--- 
Hope this helps. Now you just need to find a tool displaying these
levels.:-)


       Cheers,
       Oliver

 /---------------------------------------------------------------------\
 ¦ Oliver von Bueren                                        ovb at ovb.ch ¦
 ¦ Schlierenstr. 42                                         www.ovb.ch ¦
 ¦ 8142 Uitikon                                            Switzerland ¦
 ¦ VoicePhone: ++41-1-4920626                                          ¦
 ¦ Attention: TimeZone GMT+1 -> VoiceCalls only 09.00-21.00 local time ¦
 \---------------------------------------------------------------------/
--
To unsubcribe, send 'unsubscribe rc5' to majordomo at llamas.net
rc5-digest subscribers replace rc5 with rc5-digest



More information about the rc5 mailing list