mfc >> Question about thread priority class and level

by Pierre Couderc » Thu, 20 Jan 2005 19:40:49 GMT

The documentation about thread priorities is a bit counfusing see
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/scheduling_priorities.asp

What is the difference between a <empty> NORMAL_PRIORITY_CLASS, a
background NORMAL_PRIORITY_CLASS and a foregound NORMAL_PRIORITY_CLASS?



mfc >> RE: Question about thread priority class and level

by andmort » Fri, 21 Jan 2005 00:39:26 GMT


I guess that table could be a little misleading. Threads are either
background or foreground as per
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndllpro/ht
ml/msdn_winthr.asp

The table uses those tags to show distinction between back and fore at that
particular Thread Priority Level, so you will only see two which match the
the NORMAL_PRIORITY_CLASS against THREAD_PRIORITY_ABOVE_NORMAL . One will
be background and one will be foreground.

So it looks like where you see only NORMAL_PRIORITY_CLASS, in that table,
it should really be

background. NORMAL_PRIORITY_CLASS.

I'll feed this to doc guys for their comment.

Andy Mortimer [MS]
Please do not send email directly to this alias. This alias is for
newsgroup purposes only

This posting is provided "AS IS" with no warranties, and confers no rights.
OR if you wish to include a script sample in your post please add "Use of
included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm "





mfc >> Question about thread priority class and level

by Pierre Couderc » Fri, 21 Jan 2005 01:45:33 GMT

Thank you very much for your trial of explanation, but some mystery
remains as there would be in this case 7 levels of priority for a
background NORMAL_PRIORITY_CLASS, but only 5 for a forground
NORMAL_PRIORITY_CLASS...

PC


Andy Mortimer [MS] a rit :


Question about thread priority class and level

by andmort » Fri, 21 Jan 2005 19:17:13 GMT

This is because there is no concept of background or foreground for threads
which are marked as THREAD_PRIORITY_IDLE or THREAD_PRIORITY_TIME_CRITICAL
The scheduler will not discern between them back and fore with those
priorities.

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.

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, so it doesn't matter if it's back or fore.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/perfmon/bas
e/threadentry32_str.asp


Andy Mortimer [MS]
Please do not send email directly to this alias. This alias is for
newsgroup purposes only

This posting is provided "AS IS" with no warranties, and confers no rights.
OR if you wish to include a script sample in your post please add "Use of
included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm "





Similar Threads

1. efficient priority queue for a few descrete priority levels

Hi,

I seek for a standard solution for a priority queue with the following 
properties:

- a limited and small number of priorities
   (constructor argument or template parameter)
- multiple writers
- multiple readers
- insert O(1)
- remove O(1)
- support for dedicated high priority readers that only handle requests
   up to a certain priority level
- support for rollback (for readers only)

std::priority_queue has O(log n) and therefore does not fit.


Marcel

2. Structure Declaration (class level or proc level) - CSharp/C#

3. Multi-threaded does debugger get priority of lower priority threads?

I have a weird problem with the IDE becoming very slow while debugging. I'm beginning 
to think that the debugger might be running at the priority level of a lower priority 
thread when it hits breakpoints in that thread.

The IDE becomes very slow about repainting the main menu bar and text window. Trying 
to Reset the app is very slow. The Win2k task manager shows little CPU activity in 
BCB or the app though. 90+ % is in the system idle task.

Ever heard of problems where the whole IDE becomes very slow when debugging 
multi-threaded apps with different priority threads?

Or slowdowns involving STL containers?

4. Threading priority - CSharp/C#

5. Advanced Windows Form message priority / threading.

6. how does thread priority apply across the network - CSharp/C#

7. preventing domain from changing thread priority

It seems that even the most restricted domains can still change 
Thread.CurrentThread.ThreadPriority
Is it not possible to prevent objects in a "secure" domain from altering 
their thread priority? 


8. Thread priorities in NT - CSharp/C#