Provides methods that allow the host to make requests of the common language runtime (CLR), or to provide notification to the CLR about the associated task.
|Abort Method||Requests that the CLR abort the task that the current
|ExitTask Method||Notifies the CLR that the task associated with the current
|GetMemStats Method||Gets statistical information on the use of memory resources by the task represented by the current
|LocksHeld Method||Gets the number of locks currently held on the task.|
|NeedsPriorityScheduling Method||Gets a value indicating whether the host should assign a high priority to rescheduling the task represented by the current
|Reset Method||Informs the CLR that the host has completed a task, and enables the CLR to reuse the current
|RudeAbort Method||Causes the CLR to abort the task represented by the current
|SetTaskIdentifier Method||Sets a unique identifier for the task represented by the current
|SwitchIn Method||Notifies the CLR that the task represented by the current
|SwitchOut Method||Notifies the CLR that the task represented by the current
|YieldTask Method||Requests that the CLR make processor time available to other tasks. The CLR makes no guarantee that the task will be put in a state where it can yield processing time.|
ICLRTask is the representation of a task for the CLR. At any point during code execution, a task can be described either as running or waiting to run. The host calls the
ICLRTask::SwitchIn method to notify the CLR that the task that the current
ICLRTask instance represents is now in an operable state. After a call to
ICLRTask::SwitchIn, the host can schedule the task on any operating system thread, except in cases where the runtime requires thread-affinity, as specified by calls to the IHostTaskManager::BeginThreadAffinity and IHostTaskManager::EndThreadAffinity methods. Some time later, the operating system might decide to remove the task from the thread and place it in a non-running state. For example, this might happen whenever the task blocks on synchronization primitives, or waits for I/O operations to complete. The host calls SwitchOut to notify the CLR that the task represented by the current
ICLRTask instance is no longer in an operable state.
A task typically terminates at the end of code execution. At that time, the host calls
ICLRTask::ExitTask to destroy the associated
ICLRTask. However, tasks can also be recycled by using a call to
ICLRTask::Reset, which allows the
ICLRTask instance to be used again. This approach prevents the overhead of repeatedly creating and destroying instances.
Platforms: See System Requirements.
Library: Included as a resource in MSCorEE.dll
.NET Framework Versions: Available since 2.0