Multimedia Class Scheduler Service
The Multimedia Class Scheduler service (MMCSS) enables multimedia applications to ensure that their time-sensitive processing receives prioritized access to CPU resources. This service enables multimedia applications to utilize as much of the CPU as possible without denying CPU resources to lower-priority applications.
MMCSS uses information stored in the registry to identify supported tasks and determine the relative priority of threads performing these tasks. Each thread that is performing work related to a particular task calls the AvSetMmMaxThreadCharacteristics or AvSetMmThreadCharacteristics function to inform MMCSS that it is working on that task.
For an example of a program that uses MMCSS, see Exclusive-Mode Streams.
Windows Server 2003 and Windows XP: MMCSS is not available.
The MMCSS settings are stored in the following registry key:
This key contains a REG_DWORD value named SystemResponsiveness that determines the percentage of CPU resources that should be guaranteed to low-priority tasks. For example, if this value is 20, then 20% of CPU resources are reserved for low-priority tasks. Note that values that are not evenly divisible by 10 are rounded up to the nearest multiple of 10. A value of 0 is also treated as 10.
The key also contains a subkey named Tasks that contains the list of tasks. By default, Windows supports the following tasks:
- Pro Audio
- Window Manager
OEMs can add additional tasks as required.
Each task key contains the following set of values that represent characteristics to be applied to threads that are associated with the task.
|Affinity||REG_DWORD||A bitmask that indicates the processor affinity. Both 0x00 and 0xFFFFFFFF indicate that processor affinity is not used.|
|Background Only||REG_SZ||Indicates whether this is a background task (no user interface). The threads of a background task do not change because of a change in window focus. This value can be set to True or False.|
|BackgroundPriority||REG_DWORD||The background priority. The range of values is 1-8.|
|Clock Rate||REG_DWORD||A hint used by MMCSS to determine the granularity of processor resource scheduling.Windows Server 2008 and Windows Vista: The maximum guaranteed clock rate the system uses if a thread joins this task, in 100-nanosecond intervals. Starting with Windows 7 and Windows Server 2008 R2, this guarantee was removed to reduce system power consumption.
|GPU Priority||REG_DWORD||The GPU priority. The range of values is 0-31. This priority is not yet used.|
|Priority||REG_DWORD||The task priority. The range of values is 1 (low) to 8 (high).For tasks with a Scheduling Category of High, this value is always treated as 2.
|Scheduling Category||REG_SZ||The scheduling category. This value can be set to High, Medium, or Low.|
|SFIO Priority||REG_SZ||The scheduled I/O priority. This value can be set to Idle, Low, Normal, or High. This value is not used.|
To conserve power, applications should not set the resolution of the system-wide timer to a small value unless absolutely necessary. For more information, see Performance in the Windows 7 Developers Guide.
The MMCSS boosts the priority of threads that are working on high-priority multimedia tasks.
MMCSS determines the priority of a thread using the following factors:
- The base priority of the task.
- The Priority parameter of the AvSetMmThreadPriority function.
- Whether the application is in the foreground.
- How much CPU time is being consumed by the threads in each category.
MMCSS sets the priority of client threads depending on their scheduling category.
|High||23-26||These threads run at a thread priority that is lower than only certain system-level tasks. This category is designed for Pro Audio tasks.|
|Medium||16-22||These threads are part of the application that is in the foreground.|
|Low||8-15||This category contains the remainder of the threads. They are guaranteed a minimum percentage of the CPU resources if required.|
|1-7||These threads have used their quota of CPU resource. They can continue to run if no low-priority threads are ready to run.|