Delen via


IExecutionResource::CurrentSubscriptionLevel Method

Returns the number of activated virtual processor roots and subscribed external threads currently associated with the underlying hardware thread this execution resource represents.

virtual unsigned int CurrentSubscriptionLevel() const =0;

Return Value

The current subscription level.

Remarks

The subscription level tells you how many running threads are associated with the hardware thread. This only includes threads the Resource Manager is aware of in the form of subscribed threads, and virtual processor roots that are actively executing thread proxies.

Calling the method ISchedulerProxy::SubscribeCurrentThread, or the method ISchedulerProxy::RequestInitialVirtualProcessors with the parameter doSubscribeCurrentThread set to the value true increments the subscription level of a hardware thread by one. They also return an IExecutionResource interface representing the subscription. A corresponding call to the IExecutionResource::Remove decrements the hardware thread's subscription level by one.

The act of activating a virtual processor root using the method IVirtualProcessorRoot::Activate increments the subscription level of a hardware thread by one. The methods IVirtualProcessorRoot::Deactivate, or IExecutionResource::Remove decrement the subscription level by one when invoked on an activated virtual processor root.

The Resource Manager uses subscription level information as one of the ways in which to determine when to move resources between schedulers.

Requirements

Header: concrtrm.h

Namespace: concurrency

See Also

Reference

IExecutionResource Structure