CurrentScheduler Class

Represents an abstraction for the current scheduler associated with the calling context.

class CurrentScheduler;

Members

Public Methods

Name

Description

CurrentScheduler::Create Method

Creates a new scheduler whose behavior is described by the _Policy parameter and attaches it to the calling context. The newly created scheduler will become the current scheduler for the calling context.

CurrentScheduler::CreateScheduleGroup Method

Creates a new schedule group within the scheduler associated with the calling context.

CurrentScheduler::Detach Method

Detaches the current scheduler from the calling context and restores the previously attached scheduler as the current scheduler, if one exists. After this method returns, the calling context is then managed by the scheduler that was previously attached to the context via either the CurrentScheduler::Create or Scheduler::Attach method.

CurrentScheduler::Get Method

Returns a pointer to the scheduler associated with the calling context, also referred to as the current scheduler.

CurrentScheduler::GetNumberOfVirtualProcessors Method

Returns the current number of virtual processors for the scheduler associated with the calling context.

CurrentScheduler::GetPolicy Method

Returns a copy of the policy that the current scheduler was created with.

CurrentScheduler::Id Method

Returns a unique identifier for the current scheduler.

CurrentScheduler::RegisterShutdownEvent Method

Causes the Windows event handle passed in the _ShutdownEvent parameter to be signaled when the scheduler associated with the current context 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 may be registered through this method.

CurrentScheduler::ScheduleTask Method

Schedules a light-weight task within the scheduler associated with the calling context. The light-weight task will be placed in a schedule group of the runtime's choosing.

Remarks

If there is no scheduler (see Scheduler) associated with the calling context, many methods within the CurrentScheduler class will result in attachment of the process' default scheduler. This may also imply that the process' default scheduler is created during such a call.

Inheritance Hierarchy

CurrentScheduler

Requirements

Header: concrt.h

Namespace: Concurrency

See Also

Reference

Concurrency Namespace

Scheduler Class

PolicyElementKey Enumeration

Concepts

Task Scheduler (Concurrency Runtime)