Share via


SchedulerPolicy::SchedulerPolicy Constructor

Constructs a new scheduler policy and populates it with values for policy keys supported by Concurrency Runtime schedulers and the Resource Manager.

_CRTIMP SchedulerPolicy();
_CRTIMP SchedulerPolicy(
   size_t _PolicyKeyCount,
   ...
);
_CRTIMP SchedulerPolicy(
   const SchedulerPolicy& _SrcPolicy
);

Parameters

  • _PolicyKeyCount
    The number of key/value pairs that follow the _PolicyKeyCount parameter.

  • _SrcPolicy
    The source policy to copy.

Remarks

The first constructor creates a new scheduler policy where all policies will be initialized to their default values.

The second constructor creates a new scheduler policy that uses a named-parameter style of initialization. Values after the _PolicyKeyCount parameter are supplied as key/value pairs. Any policy key which is not specified in this constructor will have its default value. This constructor could throw the exceptions invalid_scheduler_policy_key, invalid_scheduler_policy_value or invalid_scheduler_policy_thread_specification.

The third constructor is a copy constructor. Often, the most convenient way to define a new scheduler policy is to copy an existing policy and modify it via the SetPolicyValue or SetConcurrencyLimits methods.

For more information about working with scheduler policies, including examples, see Scheduler Policies.

Requirements

Header: concrt.h

Namespace: Concurrency

See Also

Reference

SchedulerPolicy Class

SchedulerPolicy::SetPolicyValue Method

SchedulerPolicy::GetPolicyValue Method

SchedulerPolicy::SetConcurrencyLimits Method

PolicyElementKey Enumeration