|
Windows nt 0 Summary Based on articles written by Mark Russinovich
|
bet | 8/13 | Sana | 21.03.2017 | Hajmi | 455.24 Kb. | | #1031 |
ReadyThread
A process normally calls ReadyThread whenever a thread is ready to execute. The ReadyThread algorithm makes a decision as to whether the thread should be scheduled for immediate execution or placed in the ready queue (Dispatcher Ready queue)
The Balance Set Manager thread wakes up regularly and runs ScanReadyQueues to look for any threads that have not executed in more than 3 seconds. All such threads are boosted to a priority of 15 (the highest non-realtime priority)
Boosting and Decay
Threads waiting for an event to occur are given a boost of between 1-6 when the event occurs. The priority of threads decays every time a thread completes its time quantum. Boosts are cumulative, so that a thread can make its way to priority 15 (but not higher for non-realtime threads) and stay around this priority
A thread has soft affinity for a particular processor when the processor happens to be the last processor the thread executed on. Soft Affinity is the primary factor used by the scheduler to schedule threads for execution. Hard affinity for a processor is a design parameter, and can be one or more processors that the thread must execute on. An ideal processor can also be specified for a thread.
When a thread becomes ready to execute, the scheduler will first determine if there are any idle processors in the thread’s hard affinity list. If there is, then the thread begins executing on that processor. If not, the scheduler looks to only one other processor: the thread’s soft affinity processor. If this processor is currently executing a higher priority thread the ready-to-execute thread is placed in the Dispatcher Ready List (Ready Queue).
|
| |