pacemaker 3.0.3
COM automation for people with deadlines and a hatred of GUIs
 
Loading...
Searching...
No Matches
AvSetMmThreadOptions Struct Reference

Helper class for Windows Multimedia Scheduler Service (MMCSS) thread elevation. More...

#include <AvSetMmThreadOptions.hpp>

Public Member Functions

auto av_set () -> void
 Elevates the calling thread to the MMCSS "Pro Audio" task.
 
auto av_revert () -> void
 Reverts the calling thread's MMCSS scheduling characteristics.
 

Detailed Description

Helper class for Windows Multimedia Scheduler Service (MMCSS) thread elevation.

On call to av_set, registers the calling thread with the MMCSS "Pro Audio" task and sets its priority to AVRT_PRIORITY_HIGH via AvSetMmThreadCharacteristics and AvSetMmThreadPriority. On call to av_revert, reverts the thread's scheduling characteristics via AvRevertMmThreadCharacteristics.

MMCSS elevation reduces the likelihood that the Windows scheduler preempts the timer loop thread in favour of lower-priority background work, which in turn reduces jitter in the period at which Timer::wait()'s callback is invoked.

This struct is constructed as a local variable at the top of Timer::wait() so that MMCSS eleveation covers the entire loop and is automatically reverted when wait() returns, regardless of whether it returns normally or via an exception.

Note
This type is an internal implementation detail of Timer. User code should not construct it directly.
See also
pacemaker::timer::Timer::wait()

Definition at line 27 of file AvSetMmThreadOptions.hpp.

Member Function Documentation

◆ av_set()

auto av_set ( ) -> void
inline

Elevates the calling thread to the MMCSS "Pro Audio" task.

Calls AvSetMmThreadCharacteristics to register the thread via MMCSS, then calls AvSetMmThreadPriority to raise its scheduling priority within the task.

Note
if AvSetMmThreadCharacteristics fails it returns NULL; no exception is thrown in the current implementation.

Definition at line 37 of file AvSetMmThreadOptions.hpp.

◆ av_revert()

auto av_revert ( ) -> void
inline

Reverts the calling thread's MMCSS scheduling characteristics.

Calls AvRevertMmThreadCharacteristics to de-register the thread from the MMCSS "Pro Audio" task, restoring its normal scheduling behaviour.

Definition at line 50 of file AvSetMmThreadOptions.hpp.


The documentation for this struct was generated from the following file: