Share via


ISchedulerProxy::SubscribeCurrentThread Method

Registers the current thread with the Resource Manager, associating it with this scheduler.

virtual IExecutionResource * SubscribeCurrentThread() =0;

Return Value

The IExecutionResource interfacing representing the current thread in the runtime.

Remarks

Use this method if you want the Resource Manager to account for the current thread while allocating resources to your scheduler and other schedulers. It is especially useful when the thread plans to participate in the work queued to your scheduler, along with the virtual processor roots the scheduler receives from the Resource Manager. The Resource Manager uses information to prevent unnecessary oversubscription of hardware threads on the system.

The execution resource received via this method should be returned to the Resource Manager using the IExecutionResource::Remove method. The thread that calls the Remove method must be the same thread that previously called the SubscribeCurrentThread method.

The act of subscribing a thread increases the subscription level of the underlying hardware thread by one. The subscription level is reduced by one when the subscription is terminated. For more information on subscription levels, see IExecutionResource::CurrentSubscriptionLevel.

Requirements

Header: concrtrm.h

Namespace: Concurrency

See Also

Reference

ISchedulerProxy Structure