priorities

hi experts,

if in NT the entity of executain is a thread then what is the diff b/w
thread and process priority?

i can increase the process priority from taskmanager, waht effect does it
have on the threads of that process?

Bedanto wrote:

hi experts,

if in NT the entity of executain is a thread then what is the diff b/w
thread and process priority?

The process priority is a baseline on which all of the thread priorities
are based. Essentially, the two priorities are added together to make
the actual scheduling priority for the thread.

This MSDN article describes the priority scheme in Windows nicely:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/scheduling_priorities.asp


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

>if in NT the entity of executain is a thread then what is the diff b/w

thread and process priority?

Process priority is a base absolute value 0…32. Thread priority is the
relative value of -2…+2. The effective thread’s priority is the sum of both.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

so if thre are two processes A and B running with priorities 2 and 4
respecrively.

Then is it possible that a thread in process A might be running at a higher
priority than any other thread of process B, so so, then will process A have
more CPU time thatn B?

>so if thre are two processes A and B running with priorities 2 and 4

respecrively.
Then is it possible that a thread in process A might be running at a higher
priority than any other thread of process B, so so, then will process A have
more CPU time thatn B?

Yes.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

Yes that would be the intention of having explicit process and thread
priority classes.

=====================
Mark Roddy DDK MVP
Windows 2003/XP/2000 Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Bedanto
Sent: Thursday, April 20, 2006 2:47 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] priorities

so if thre are two processes A and B running with priorities 2 and 4
respecrively.

Then is it possible that a thread in process A might be running at a higher
priority than any other thread of process B, so so, then will process A have
more CPU time thatn B?
— Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the List
Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Yes, it is possible. I wouldn’t say that process A has more CPU time
than B, though, because processes don’t get granted CPU time. Threads
do. Whether the sum total of all the threads in process A gets more CPU
time than those of process B depends on how many threads are in each
process and what priority the rest of the threads have.

Beverly


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Bedanto
Sent: Thursday, April 20, 2006 1:47 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] priorities

so if thre are two processes A and B running with priorities 2 and 4
respecrively.

Then is it possible that a thread in process A might be running at a
higher priority than any other thread of process B, so so, then will
process A have more CPU time thatn B?
— Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the
List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Bedanto wrote:

so if thre are two processes A and B running with priorities 2 and 4
respecrively.

Then is it possible that a thread in process A might be running at a
higher priority than any other thread of process B, so so, then will
process A have more CPU time thatn B?

Did you even read the MSDN page I pointed out? It includes a chart that
shows the relative order of the combinations of process and thread
priority, and answers much of this.

The process priority classes are in pretty big increments:

#define NORMAL_PRIORITY_CLASS 0x00000020
#define IDLE_PRIORITY_CLASS 0x00000040
#define HIGH_PRIORITY_CLASS 0x00000080
#define REALTIME_PRIORITY_CLASS 0x00000100

The normal thread priority range is narrow enough that the ranges don’t
overlap.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.