Scheduler Class
Represents an abstraction for a Concurrency Runtime scheduler.
class Scheduler;
Members
Protected Constructors
Name |
Description |
---|---|
An object of the Scheduler class can only created using factory methods, or implicitly. |
|
An object of the Scheduler class is implicitly destroyed when all external references to it cease to exist. |
Public Methods
Name |
Description |
---|---|
Attaches the scheduler to the calling context. After this method returns, the calling context is managed by the scheduler and the scheduler becomes the current scheduler. |
|
Creates a new scheduler whose behavior is described by the _Policy parameter, places an initial reference on the scheduler, and returns a pointer to it. |
|
Overloaded. Creates a new schedule group within the scheduler. The version that takes the parameter _Placement causes tasks within the newly created schedule group to be biased towards executing at the location specified by that parameter. |
|
Returns the current number of virtual processors for the scheduler. |
|
Returns a copy of the policy that the scheduler was created with. |
|
Returns a unique identifier for the scheduler. |
|
Determines whether a given location is available on the scheduler. |
|
Increments the scheduler reference count. |
|
Causes the Windows event handle passed in the _Event parameter to be signaled when the scheduler shuts down and destroys itself. At the time the event is signaled, all work that had been scheduled to the scheduler is complete. Multiple shutdown events can be registered through this method. |
|
Decrements the scheduler reference count. |
|
Resets the default scheduler policy to the runtime default. The next time a default scheduler is created, it will use the runtime default policy settings. |
|
Overloaded. Schedules a light-weight task within the scheduler. The light-weight task will be placed in a schedule group determined by the runtime. The version that takes the parameter _Placement causes the task to be biased towards executing at the specified location. |
|
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. |
Remarks
The Concurrency Runtime scheduler uses execution contexts, which map to the operating system execution contexts, such as a thread, to execute the work queued to it by your application. At any time, the concurrency level of a scheduler is equal to the number of virtual processor granted to it by the Resource Manager. A virtual processor is an abstraction for a processing resource and maps to a hardware thread on the underlying system. Only a single scheduler context can execute on a virtual processor at a given time.
The Concurrency Runtime will create a default scheduler per process to execute parallel work. In addition you can create your own scheduler instances and manipulate it using this class.
Inheritance Hierarchy
Scheduler
Requirements
Header: concrt.h
Namespace: concurrency