Scheduler::SetDefaultSchedulerPolicy Method

Allows a user defined policy to be used to create the default scheduler. This method can be called only when no default scheduler exists within the process. After a default policy has been set, it remains in effect until the next valid call to either the SetDefaultSchedulerPolicy or the ResetDefaultSchedulerPolicy method.

static void __cdecl SetDefaultSchedulerPolicy(
   const SchedulerPolicy& _Policy


  • _Policy
    The policy to be set as the default scheduler policy.


If the SetDefaultSchedulerPolicy method is called when a default scheduler already exists within the process, the runtime will throw a default_scheduler_exists exception.


Header: concrt.h

Namespace: concurrency

See Also


Scheduler Class

Scheduler::ResetDefaultSchedulerPolicy Method

SchedulerPolicy Class

PolicyElementKey Enumeration


Task Scheduler (Concurrency Runtime)