ScheduleGroup Class
Represents an abstraction for a schedule group. Schedule groups organize a set of related work that benefits from being scheduled close together either temporally, by executing another task in the same group before moving to another group, or spatially, by executing multiple items within the same group on the same NUMA node or physical socket.
class ScheduleGroup;
Name | Description |
---|---|
~ScheduleGroup Destructor |
Name | Description |
---|---|
Id | Returns an identifier for the schedule group that is unique within the scheduler to which the group belongs. |
Reference | Increments the schedule group reference count. |
Release | Decrements the scheduler group reference count. |
ScheduleTask | Schedules a light-weight task within the schedule group. |
ScheduleGroup
Header: concrt.h
Namespace: concurrency
Returns an identifier for the schedule group that is unique within the scheduler to which the group belongs.
virtual unsigned int Id() const = 0;
An identifier for the schedule group that is unique within the scheduler to which the group belongs.
A ScheduleGroup
object is destroyed internally by the runtime when all external references to it are released. It cannot be explicitly deleted.
void operator delete(
void* _PObject);
void operator delete(
void* _PObject,
int,
const char *,
int);
_PObject
A pointer to the object to be deleted.
Increments the schedule group reference count.
virtual unsigned int Reference() = 0;
The newly incremented reference count.
This is typically used to manage the lifetime of the schedule group for composition. When the reference count of a schedule group falls to zero, the schedule group is deleted by the runtime. A schedule group created using either the CurrentScheduler::CreateScheduleGroup method, or the Scheduler::CreateScheduleGroup method starts out with a reference count of one.
Decrements the scheduler group reference count.
virtual unsigned int Release() = 0;
The newly decremented reference count.
This is typically used to manage the lifetime of the schedule group for composition. When the reference count of a schedule group falls to zero, the schedule group is deleted by the runtime. After you have called the Release
method the specific number of times to remove the creation reference count and any additional references placed using the Reference
method, you cannot utilize the schedule group further. Doing so will result in undefined behavior.
A schedule group is associated with a particular scheduler instance. You must ensure that all references to the schedule group are released before all references to the scheduler are released, because the latter could result in the scheduler being destroyed. Doing otherwise results in undefined behavior.
virtual ~ScheduleGroup();
Schedules a light-weight task within the schedule group.
virtual void ScheduleTask(
TaskProc _Proc,
_Inout_opt_ void* _Data) = 0;
_Proc
A pointer to the function to execute to perform the body of the light-weight task.
_Data
A void pointer to the data that will be passed as a parameter to the body of the task.
Calling the ScheduleTask
method implicitly places a reference count on the schedule group which is removed by the runtime at an appropriate time after the task executes.
concurrency Namespace
CurrentScheduler Class
Scheduler Class
Task Scheduler