Execution Priority

The primary scheduler assigns an execution priority value to a each thread. The VMM grants processor time only to threads that share the highest execution priority. A thread with an execution priority lower than the highest priority does not receive any processor time; that is, it is suspended. (Note that this should not be confused with the concept of a virtual machine being suspended.)

The VMM assigns an execution priority to a thread when the thread is created. The VMM and virtual devices can subsequently raise or lower the execution priority, causing the processor to switch from one thread to another. If the new thread belongs to a different virtual machine, the VMM performs a task switch to the new virtual machine, making it the current virtual machine. The VMM often temporarily raises the execution priority for a thread that needs to service a high-priority device event, such as an interrupt that must be serviced in a timely manner.

A virtual device can raise or lower the priority of a thread by calling the Adjust_Exec_Priority or Adjust_Thread_Exec_Priority service. Use Adjust_Thread_Exec_Priority to adjust the execution priority of a thread in the system virtual machine, and Adjust_Exec_Priority to adjust the execution priority of the thread in a non-system virtual machine. If you specify the handle of the system virtual machine in a call to Adjust_Exec_Priority, the VMM adjusts the priority of the system virtual machine's initial thread.

See also Adjust_Exec_Priority, Adjust_Thread_Exec_Priority