Context Class
Represents an abstraction for an execution context.
class Context;
Members
Public Methods
Name |
Description |
---|---|
Blocks the current context. |
|
Returns a pointer to the current context. |
|
Returns an identifier for the context that is unique within the scheduler to which the context belongs. |
|
Returns an identifier for the schedule group that the context is currently working on. |
|
Returns an identifier for the virtual processor that the context is currently executing on. |
|
Returns an identifier for the current context that is unique within the scheduler to which the current context belongs. |
|
Returns an indication of whether the task collection which is currently executing inline on the current context is in the midst of an active cancellation (or will be shortly). |
|
Determines whether or not the context is synchronously blocked. A context is considered to be synchronously blocked if it explicitly performed an action which led to blocking. |
|
Injects an additional virtual processor into a scheduler for the duration of a block of code when invoked on a context executing on one of the virtual processors in that scheduler. |
|
Returns an identifier for the schedule group that the current context is working on. |
|
Unblocks the context and causes it to become runnable. |
|
Returns an identifier for the virtual processor that the current context is executing on. |
|
Yields execution so that another context can execute. If no other context is available to yield to, the scheduler can yield to another operating system thread. |
Protected Operators
Name |
Description |
---|---|
A Context object is destroyed internally by the runtime. It can not be explicitly deleted. |
Remarks
The Concurrency Runtime scheduler (see Scheduler) uses execution contexts to execute the work queued to it by your application. A Win32 thread is an example of an execution context on a Windows operating system.
At any time, the concurrency level of a scheduler is equal to the number of virtual processors granted to it by the Resource Manager. A virtual processor is an abstraction for a processing resource and maps to a hardware thread on the underlying system. Only a single scheduler context can execute on a virtual processor at a given time.
The scheduler is cooperative in nature and an executing context can yield its virtual processor to a different context at any time if it wishes to enter a wait state. When its wait it satisfied, it cannot resume until an available virtual processor from the scheduler begins executing it.
Inheritance Hierarchy
Context
Requirements
Header: concrt.h
Namespace: concurrency