CurrentScheduler 클래스CurrentScheduler Class
호출 컨텍스트와 연결된 현재 스케줄러에 대한 추상화를 나타냅니다.Represents an abstraction for the current scheduler associated with the calling context.
구문Syntax
class CurrentScheduler;
멤버Members
Public 메서드Public Methods
이름Name | DescriptionDescription |
---|---|
만들기Create | 매개 변수에서 동작을 설명 하는 새 스케줄러를 만들어 _Policy 호출 컨텍스트에 연결 합니다.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. |
CreateScheduleGroupCreateScheduleGroup | 오버로드됨.Overloaded. 호출 컨텍스트와 연결 된 스케줄러 내에 새 일정 그룹을 만듭니다.Creates a new schedule group within the scheduler associated with the calling context. 매개 변수를 사용 하는 버전은 _Placement 새로 만든 일정 그룹 내의 태스크가 해당 매개 변수로 지정 된 위치에서 실행 될 때 편향 되도록 합니다.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. |
분리Detach | 호출 컨텍스트에서 현재 스케줄러를 분리 하 고 이전에 연결 된 스케줄러를 현재 스케줄러로 복원 합니다 (있는 경우).Detaches the current scheduler from the calling context and restores the previously attached scheduler as the current scheduler, if one exists. 이 메서드가 반환 된 후에는 또는 메서드를 사용 하 여 컨텍스트에 이전에 연결 된 스케줄러에서 호출 컨텍스트를 관리 CurrentScheduler::Create 합니다 Scheduler::Attach .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. |
가져오기Get | 호출 컨텍스트와 연결 된 스케줄러에 대 한 포인터를 반환 합니다. 현재 스케줄러 라고도 합니다.Returns a pointer to the scheduler associated with the calling context, also referred to as the current scheduler. |
GetNumberOfVirtualProcessorsGetNumberOfVirtualProcessors | 호출 컨텍스트와 연결 된 스케줄러의 현재 가상 프로세서 수를 반환 합니다.Returns the current number of virtual processors for the scheduler associated with the calling context. |
GetPolicyGetPolicy | 현재 스케줄러를 만든 정책의 복사본을 반환 합니다.Returns a copy of the policy that the current scheduler was created with. |
IDId | 현재 스케줄러에 대 한 고유 식별자를 반환 합니다.Returns a unique identifier for the current scheduler. |
IsAvailableLocationIsAvailableLocation | 현재 스케줄러에서 지정된 위치를 사용할 수 있는지를 확인합니다.Determines whether a given location is available on the current scheduler. |
RegisterShutdownEventRegisterShutdownEvent | _ShutdownEvent 현재 컨텍스트와 연결 된 스케줄러를 종료 하 고 자체를 소멸 시킬 때 매개 변수에 전달 된 Windows 이벤트 핸들이 신호를 받도록 합니다.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. |
ScheduleTaskScheduleTask | 오버로드됨.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. _Placement 매개 변수를 사용하는 버전은 작업이 지정된 위치에서 실행되도록 합니다.The version that takes the parameter _Placement causes the task to be biased towards executing at the specified location. |
설명Remarks
호출 컨텍스트와 연결 된 스케줄러 ( scheduler참조)가 없는 경우 클래스 내의 많은 메서드가 CurrentScheduler
프로세스의 기본 스케줄러를 첨부 합니다.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
헤더: concrt .hHeader: concrt.h
네임 스페이스: 동시성Namespace: concurrency
만들기Create
매개 변수에서 동작을 설명 하는 새 스케줄러를 만들어 _Policy
호출 컨텍스트에 연결 합니다.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.
static void __cdecl Create(const SchedulerPolicy& _Policy);
매개 변수Parameters
_Policy_Policy
새로 만든 스케줄러의 동작을 설명 하는 스케줄러 정책입니다.The scheduler policy that describes the behavior of the newly created scheduler.
설명Remarks
스케줄러를 호출 컨텍스트에 첨부 하면 암시적으로 스케줄러에 참조 횟수가 추가 됩니다.The attachment of the scheduler to the calling context implicitly places a reference count on the scheduler.
메서드를 사용 하 여 스케줄러를 만든 후에는 Create
나중에 etach 메서드를:D 호출 하 여 스케줄러가 종료 될 수 있도록 해야 합니다.After a scheduler is created with the Create
method, you must call the CurrentScheduler::Detach method at some point in the future in order to allow the scheduler to shut down.
이 메서드가 다른 스케줄러에 이미 연결 되어 있는 컨텍스트에서 호출 되는 경우 기존 스케줄러는 이전 스케줄러로 기억 되 고 새로 만든 스케줄러는 현재 스케줄러가 됩니다.If this method is called from a context that is already attached to a different scheduler, the existing scheduler is remembered as the previous scheduler, and the newly created scheduler becomes the current scheduler. CurrentScheduler::Detach
이후 시점에서 메서드를 호출 하면 이전 스케줄러가 현재 스케줄러로 복원 됩니다.When you call the CurrentScheduler::Detach
method at a later point, the previous scheduler is restored as the current scheduler.
이 메서드는 scheduler_resource_allocation_error 및 invalid_scheduler_policy_value를 포함 하 여 다양 한 예외를 throw 할 수 있습니다.This method can throw a variety of exceptions, including scheduler_resource_allocation_error and invalid_scheduler_policy_value.
CreateScheduleGroupCreateScheduleGroup
호출 컨텍스트와 연결 된 스케줄러 내에 새 일정 그룹을 만듭니다.Creates a new schedule group within the scheduler associated with the calling context. 매개 변수를 사용 하는 버전은 _Placement
새로 만든 일정 그룹 내의 태스크가 해당 매개 변수로 지정 된 위치에서 실행 될 때 편향 되도록 합니다.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.
static ScheduleGroup* __cdecl CreateScheduleGroup();
static ScheduleGroup* __cdecl CreateScheduleGroup(location& _Placement);
매개 변수Parameters
_Placement_Placement
일정 그룹 내의 태스크가에서 실행 될 때 편향 되는 위치에 대 한 참조입니다.A reference to a location where the tasks within the schedule group will be biased towards executing at.
반환 값Return Value
새로 만든 일정 그룹에 대 한 포인터입니다.A pointer to the newly created schedule group. 이 ScheduleGroup
개체에는 초기 참조 수가 배치 되어 있습니다.This ScheduleGroup
object has an initial reference count placed on it.
설명Remarks
이 메서드를 사용하면 현재 호출 컨텍스트와 연결된 스케줄러가 없는 경우 프로세스의 기본 스케줄러가 생성되고 호출 컨텍스트에 연결됩니다.This method will result in the process' default scheduler being created and/or attached to the calling context if there is no scheduler currently associated with the calling context.
작업 예약을 완료 한 후에는 일정 그룹에서 Release 메서드를 호출 해야 합니다.You must invoke the Release method on a schedule group when you are done scheduling work to it. 스케줄러는 대기 중인 모든 작업이 완료 되 면 일정 그룹을 삭제 합니다.The scheduler will destroy the schedule group when all work queued to it has completed.
이 스케줄러를 명시적으로 만든 경우에는 현재 컨텍스트를 분리 하 여 스케줄러에서 참조를 해제 하기 전에 해당 스케줄러 내에서 일정 그룹에 대 한 모든 참조를 해제 해야 합니다.Note that if you explicitly created this scheduler, you must release all references to schedule groups within it, before you release your reference on the scheduler, by detaching the current context from it.
분리Detach
호출 컨텍스트에서 현재 스케줄러를 분리 하 고 이전에 연결 된 스케줄러를 현재 스케줄러로 복원 합니다 (있는 경우).Detaches the current scheduler from the calling context and restores the previously attached scheduler as the current scheduler, if one exists. 이 메서드가 반환 된 후에는 또는 메서드를 사용 하 여 컨텍스트에 이전에 연결 된 스케줄러에서 호출 컨텍스트를 관리 CurrentScheduler::Create
합니다 Scheduler::Attach
.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.
static void __cdecl Detach();
설명Remarks
Detach
메서드는 스케줄러에서 참조 횟수를 암시적으로 제거 합니다.The Detach
method implicitly removes a reference count from the scheduler.
호출 컨텍스트에 연결 된 스케줄러가 없는 경우이 메서드를 호출 하면 scheduler_not_attached 예외가 발생 합니다.If there is no scheduler attached to the calling context, calling this method will result in a scheduler_not_attached exception being thrown.
스케줄러에서 내부 및 관리 되는 컨텍스트에서이 메서드를 호출 하거나 scheduler:: Attach 또는 Currentscheduler:: Create 메서드 이외의 메서드를 사용 하 여 연결 된 컨텍스트를 호출 하면 improper_scheduler_detach 예외가 throw 됩니다.Calling this method from a context that is internal to and managed by a scheduler, or a context that was attached using a method other than the Scheduler::Attach or CurrentScheduler::Create methods, will result in an improper_scheduler_detach exception being thrown.
가져오기Get
호출 컨텍스트와 연결 된 스케줄러에 대 한 포인터를 반환 합니다. 현재 스케줄러 라고도 합니다.Returns a pointer to the scheduler associated with the calling context, also referred to as the current scheduler.
static Scheduler* __cdecl Get();
반환 값Return Value
호출 컨텍스트 (현재 스케줄러)와 연결 된 스케줄러에 대 한 포인터입니다.A pointer to the scheduler associated with the calling context (the current scheduler).
설명Remarks
이 메서드를 사용하면 현재 호출 컨텍스트와 연결된 스케줄러가 없는 경우 프로세스의 기본 스케줄러가 생성되고 호출 컨텍스트에 연결됩니다.This method will result in the process' default scheduler being created and/or attached to the calling context if there is no scheduler currently associated with the calling context. 이 메서드에서 반환 하는 개체에 추가 참조가 배치 되지 않습니다 Scheduler
.No additional reference is placed on the Scheduler
object returned by this method.
GetNumberOfVirtualProcessorsGetNumberOfVirtualProcessors
호출 컨텍스트와 연결 된 스케줄러의 현재 가상 프로세서 수를 반환 합니다.Returns the current number of virtual processors for the scheduler associated with the calling context.
static unsigned int __cdecl GetNumberOfVirtualProcessors();
반환 값Return Value
스케줄러가 호출 컨텍스트와 연결 된 경우 해당 스케줄러에 대 한 현재 가상 프로세서 수입니다. 그렇지 않으면 값 -1
입니다.If a scheduler is associated with the calling context, the current number of virtual processors for that scheduler; otherwise, the value -1
.
설명Remarks
호출 컨텍스트가 스케줄러에 아직 연결 되지 않은 경우이 메서드는 스케줄러 첨부 파일을 생성 하지 않습니다.This method will not result in scheduler attachment if the calling context is not already associated with a scheduler.
이 메서드의 반환 값은 호출 컨텍스트와 연결 된 스케줄러의 가상 프로세서 수에 대 한 즉각적인 샘플링입니다.The return value from this method is an instantaneous sampling of the number of virtual processors for the scheduler associated with the calling context. 이 값은 반환되는 순간 부실 값이 될 수 있습니다.This value can be stale the moment it is returned.
GetPolicyGetPolicy
현재 스케줄러를 만든 정책의 복사본을 반환 합니다.Returns a copy of the policy that the current scheduler was created with.
static SchedulerPolicy __cdecl GetPolicy();
반환 값Return Value
현재 스케줄러를 만든 정책의 복사본입니다.A copy of the policy that the current scheduler was created with.
설명Remarks
이 메서드를 사용하면 현재 호출 컨텍스트와 연결된 스케줄러가 없는 경우 프로세스의 기본 스케줄러가 생성되고 호출 컨텍스트에 연결됩니다.This method will result in the process' default scheduler being created and/or attached to the calling context if there is no scheduler currently associated with the calling context.
A-idId
현재 스케줄러에 대 한 고유 식별자를 반환 합니다.Returns a unique identifier for the current scheduler.
static unsigned int __cdecl Id();
반환 값Return Value
스케줄러가 호출 컨텍스트와 연결 된 경우 해당 스케줄러에 대 한 고유 식별자입니다. 그렇지 않으면 값 -1
입니다.If a scheduler is associated with the calling context, a unique identifier for that scheduler; otherwise, the value -1
.
설명Remarks
호출 컨텍스트가 스케줄러에 아직 연결 되지 않은 경우이 메서드는 스케줄러 첨부 파일을 생성 하지 않습니다.This method will not result in scheduler attachment if the calling context is not already associated with a scheduler.
IsAvailableLocationIsAvailableLocation
현재 스케줄러에서 지정된 위치를 사용할 수 있는지를 확인합니다.Determines whether a given location is available on the current scheduler.
static bool __cdecl IsAvailableLocation(const location& _Placement);
매개 변수Parameters
_Placement_Placement
현재 스케줄러를 쿼리하는 위치에 대한 참조입니다.A reference to the location to query the current scheduler about.
반환 값Return Value
_Placement
인수로 지정된 위치를 현재 스케줄러에서 사용할 수 있는지 여부를 나타냅니다.An indication of whether or not the location specified by the _Placement
argument is available on the current scheduler.
설명Remarks
호출 컨텍스트가 스케줄러에 아직 연결 되지 않은 경우이 메서드는 스케줄러 첨부 파일을 생성 하지 않습니다.This method will not result in scheduler attachment if the calling context is not already associated with a scheduler.
반환 값은 지정된 위치를 사용할 수 있는지 여부의 순간 샘플링입니다.Note that the return value is an instantaneous sampling of whether the given location is available. 여러 스케줄러가 있으면 동적 자원 관리에서 어느 시점에 스케줄러의 리소스를 추가하거나 제거할 수 있습니다.In the presence of multiple schedulers, dynamic resource management can add or take away resources from schedulers at any point. 이 경우 지정된 위치의 가용성이 변경될 수 있습니다.Should this happen, the given location can change availability.
RegisterShutdownEventRegisterShutdownEvent
_ShutdownEvent
현재 컨텍스트와 연결 된 스케줄러를 종료 하 고 자체를 소멸 시킬 때 매개 변수에 전달 된 Windows 이벤트 핸들이 신호를 받도록 합니다.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.
static void __cdecl RegisterShutdownEvent(HANDLE _ShutdownEvent);
매개 변수Parameters
_ShutdownEvent_ShutdownEvent
현재 컨텍스트와 연결 된 스케줄러를 종료 하 고 자체를 소멸 시킬 때 런타임에 의해 신호를 받는 Windows 이벤트 개체에 대 한 핸들입니다.A handle to a Windows event object which will be signaled by the runtime when the scheduler associated with the current context shuts down and destroys itself.
설명Remarks
호출 컨텍스트에 연결 된 스케줄러가 없는 경우이 메서드를 호출 하면 scheduler_not_attached 예외가 발생 합니다.If there is no scheduler attached to the calling context, calling this method will result in a scheduler_not_attached exception being thrown.
ScheduleTaskScheduleTask
호출 컨텍스트와 연결 된 스케줄러 내에서 경량 작업을 예약 합니다.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. _Placement
매개 변수를 사용하는 버전은 작업이 지정된 위치에서 실행되도록 합니다.The version that takes the parameter _Placement
causes the task to be biased towards executing at the specified location.
static void __cdecl ScheduleTask(
TaskProc _Proc,
_Inout_opt_ void* _Data);
static void __cdecl ScheduleTask(
TaskProc _Proc,
_Inout_opt_ void* _Data,
location& _Placement);
매개 변수Parameters
_Proc_Proc
경량 작업 본문을 수행 하기 위해 실행 하는 함수에 대 한 포인터입니다.A pointer to the function to execute to perform the body of the light-weight task.
_Data_Data
작업 본문에 매개 변수로 전달 될 데이터에 대 한 void 포인터입니다.A void pointer to the data that will be passed as a parameter to the body of the task.
_Placement_Placement
간단한 작업이 실행될 수 있는 위치에 대한 참조입니다.A reference to a location where the light-weight task will be biased towards executing at.
설명Remarks
이 메서드를 사용하면 현재 호출 컨텍스트와 연결된 스케줄러가 없는 경우 프로세스의 기본 스케줄러가 생성되고 호출 컨텍스트에 연결됩니다.This method will result in the process' default scheduler being created and/or attached to the calling context if there is no scheduler currently associated with the calling context.
참고 항목See also
concurrency 네임 스페이스concurrency Namespace
Scheduler 클래스Scheduler Class
PolicyElementKeyPolicyElementKey
작업 SchedulerTask Scheduler