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

Overloaded. Creates a new schedule group within the scheduler associated with the calling context. 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.

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 using 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::IsAvailableLocation Method

Determines whether a given location is available on 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 can be registered through this method.

CurrentScheduler::ScheduleTask Method

Overloaded. Schedules a light-weight task within the scheduler associated with the calling context. 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.

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)