IExecutionResource::Remove Method

Returns this execution resource to the Resource Manager.

virtual void Remove(
   _Inout_ IScheduler * pScheduler
) =0;


  • pScheduler
    An interface to the scheduler making the request to remove this execution resource.


Use this method to return standalone execution resources as well as execution resources associated with virtual processor roots to the Resource Manager.

If this is a standalone execution resource you received from either of the methods ISchedulerProxy::SubscribeCurrentThread or ISchedulerProxy::RequestInitialVirtualProcessors, calling the method Remove will end the thread subscription that the resource was created to represent. You are required to end all thread subscriptions before shutting down a scheduler proxy, and must call Remove from the thread that created the subscription.

Virtual processor roots, too, can be returned to the Resource Manager by invoking the Remove method, because the interface IVirtualProcessorRoot inherits from the IExecutionResource interface. You may need to return a virtual processor root either in response to a call to the IScheduler::RemoveVirtualProcessors method, or when you are done with an oversubscribed virtual processor root you obtained from the ISchedulerProxy::CreateOversubscriber method. For virtual processor roots, there are no restrictions on which thread can invoke the Remove method.

invalid_argument is thrown if the parameter pScheduler is set to NULL.

invalid_operation is thrown if the parameter pScheduler is different from the scheduler that this execution resource was created for, or, with a standalone execution resource, if the current thread is different from the thread that created the thread subscription.


Header: concrtrm.h

Namespace: concurrency

See Also


IExecutionResource Structure

invalid_argument Class

invalid_operation Class