Dynamically variable idle time thread scheduling
AssigneeMicrosoft Corporation
InventorMichael Ginsberg
Life of this patent
Estimating the term…
Abstract
Systems and methods for dynamically variable idle time thread scheduling are described. In one aspect, threads are scheduled according to a predetermined periodic rate. If there are no threads to execute, one or more hardware elements and program modules are deactivated to an idle state for a dynamic variable amount of time. The dynamic variable amount of time is independent of the predetermined periodic rate at which threads are scheduled. The dynamic variable amount of time is also independent of key press events, and any event associated with release of a resource. Instead, the dynamic variable amount of time is based on a sleep state of a set of threads in a sleep queue.
Claims17
A computer implemented method for providing thread scheduling in a device, the device comprising one or more hardware elements operatively coupled to an operating system comprising a plurality of program modules, the method comprising:
- scheduling one or more threads according to a predetermined periodic rate;
- determining whether or not there are any threads to execute;
- and
- responsive to a determination that there are no threads to execute, determining by a scheduler a dynamic variable amount of time based on a maximum amount of time that a thread can yield before needing to be scheduled for execution, wherein the maximum amount of time is based on a sleep state of a set of threads in a sleep queue, the dynamic variable amount of time being independent of the predetermined periodic rate, a key press event, and any event associated with release of a resource, and deactivating one or more of the hardware elements and the program modules for said dynamic variable amount of time, wherein the one or more of the hardware elements and the program modules are going to be activated again only when the operating system needs to perform scheduling a thread for execution upon expiration of the dynamic variable amount of time since the deactivating.
A computer storage medium containing computer-executable instructions for scheduling threads in a device, the device including an operating system comprised of a plurality of program modules that are in turn coupled to one or more hardware elements, the computer-executable instructions comprising instructions for:
- determining at a periodic rate whether or not there are any threads to execute;
- and
- responsive to a determination that there are no threads to execute, determining by a scheduler a dynamic variable amount of time based on a maximum amount of time that a thread can yield before needing to be scheduled for execution, wherein the maximum amount of time is based on a sleep state of a set of threads in a sleep queue, the dynamic variable amount of time being independent of the predetermined periodic rate, a key press event, and any event associated with release of a resource, and deactivating one or more of the program modules and the hardware elements for said dynamic variable amount of time, wherein the one or more of the hardware elements and the program modules are going to be activated again only when the operating system needs to perform scheduling a thread for execution upon expiration of the dynamic variable amount of time since the deactivating.
A device comprising:
- a processor;
- a plurality of hardware elements coupled to the processor;
- and
- a memory coupled to the processor, the memory comprising computer-program instructions executable by the processor, the computer-program instructions comprising a scheduler program module, a hardware abstraction layer (HAL) program module, one or more operating system program modules, and a set of application program modules;
- wherein the scheduler comprises computer-executable instructions for:
- scheduling threads for execution at a periodic time interval;
- determining that there are no threads to execute;
- in response to there are no thread to execute, determining a dynamic variable amount of time based on a maximum amount of time that a thread can yield before needing to be scheduled for execution, wherein the maximum amount of time is based on a sleep state of a set of threads in a sleep queue, the dynamic variable amount of time being independent of the predetermined periodic rate, a key press event, and any event associated with release of a resource;
- and
- wherein the HAL, responsive to the determining there are no threads to execute and to the dynamic variable amount of time, further comprises computer-executable instructions for deactivating, for said dynamic variable amount of time, the scheduler, the hardware elements, the one or more operating system program modules, and the set of application program modules.
Dependencies are inferred from the claim text.