IUMSScheduler Structure
An interface to an abstraction of a work scheduler that wants the Concurrency Runtime's Resource Manager to hand it user-mode schedulable (UMS) threads. The Resource Manager uses this interface to communicate with UMS thread schedulers. The IUMSScheduler
interface inherits from the IScheduler
interface.
struct IUMSScheduler : public IScheduler;
Name | Description |
---|---|
IUMSScheduler::SetCompletionList | Assigns an IUMSCompletionList interface to a UMS thread scheduler. |
If you are implementing a custom scheduler that communicates with the Resource Manager, and you want UMS threads to be handed to your scheduler instead of ordinary Win32 threads, you should provide an implementation of the IUMSScheduler
interface. In addition, you should set the policy value for the scheduler policy key SchedulerKind
to be UmsThreadDefault
. If the policy specifies UMS thread, the IScheduler
interface that is passed as a parameter to the IResourceManager::RegisterScheduler method must be an IUMSScheduler
interface.
The Resource Manager is able to hand you UMS threads only on operating systems that have the UMS feature. 64-bit operating systems with version Windows 7 and higher support UMS threads. If you create a scheduler policy with the SchedulerKind
key set to the value UmsThreadDefault
and the underlying platform does not support UMS, the value of the SchedulerKind
key on that policy will be changed to the value ThreadScheduler
. You should always read back this policy value before expecting to receive UMS threads.
The IUMSScheduler
interface is one end of a two-way channel of communication between a scheduler and the Resource Manager. The other end is represented by the IResourceManager
and ISchedulerProxy
interfaces, which are implemented by the Resource Manager.
IUMSScheduler
Header: concrtrm.h
Namespace: concurrency
Assigns an IUMSCompletionList
interface to a UMS thread scheduler.
virtual void SetCompletionList(_Inout_ IUMSCompletionList* pCompletionList) = 0;
pCompletionList
The completion list interface for the scheduler. There is a single list per scheduler.
The Resource Manager will invoke this method on a scheduler that specifies it wants UMS threads, after the scheduler has requested an initial allocation of resources. The scheduler can use the IUMSCompletionList
interface to determine when UMS thread proxies have unblocked. It is only valid to access this interface from a thread proxy running on a virtual processor root assigned to the UMS scheduler.
concurrency Namespace
PolicyElementKey
IScheduler Structure
IUMSCompletionList Structure
IResourceManager Structure