STLdoc
STLdocumentation
|
Async Task collections is a thin wrapper over task collection to cater to the execution of asynchronous chores (or tasks defined in ppltasks.h). Specifically, they manage their own lifetime by using reference counts. Scheduling a chore acquires a reference and on completion of its execution the reference is released. More...
#include <concrt.h>
Public Member Functions | |
_AsyncTaskCollection (const _AsyncTaskCollection &)=delete | |
_AsyncTaskCollection & | operator= (const _AsyncTaskCollection &)=delete |
_TaskCollectionStatus | _ScheduleWithAutoInline (_UnrealizedChore *_PChore, _TaskInliningMode _InliningMode) |
Schedule a chore with automatic inlining. The chore is pushed onto the associated workstealing queue, and will be executed in a LIFO order. The tasks scheduled into a _TaskCollection are scheduled into the current scheduler. Note that the specified chore can be scheduled only on a single task collection at a given time. Any attempt to schedule the same chore multiple times on one or more task collections will result in an invalid_multiple_scheduling exception. After the chore is guaranteed to have been executed (by calling the Wait method), it can be rescheduled to an arbitrary task collection. This schedule method will perform automatic inlining base on . More... | |
void | _Cancel () |
Cancels work on the task collection. More... | |
_TaskCollectionStatus | _RunAndWait () |
A cancellation friendly wrapper with which to execute _PChore and then waits for all chores running in the _TaskCollection to finish (normally or abnormally). This method encapsulates all the running tasks in an exception handling block, and will re-throw any exceptions that occur in any of it tasks (if those exceptions occur on another thread, they are marshaled from that thread to the thread where the _TaskCollection was created, and re-thrown). After this function returns, the _TaskCollection cannot be used for scheduling further work. More... | |
Public Member Functions inherited from Concurrency::details::_RefCounterBase | |
virtual | ~_RefCounterBase () |
long | _Reference () |
long | _Release () |
Static Public Member Functions | |
static _CONCRTIMP _AsyncTaskCollection *__cdecl | _NewCollection (_CancellationTokenState *_PTokenState) |
Constructs a new task collection whose cancellation is governed by the specified cancellation token state. More... | |
Private Member Functions | |
void | _NotificationHandler () |
virtual _CONCRTIMP void | _Destroy () |
_AsyncTaskCollection (_CancellationTokenState *_PTokenState) | |
__declspec (noinline) static void __cdecl _CompletionHandler(void *_PCompletionContext) | |
Private Attributes | |
_TaskCollection | _M_taskCollection |
Additional Inherited Members | |
Protected Member Functions inherited from Concurrency::details::_RefCounterBase | |
_RefCounterBase (long _InitialCount=1) | |
Protected Attributes inherited from Concurrency::details::_RefCounterBase | |
volatile long | _M_refCount |
Async Task collections is a thin wrapper over task collection to cater to the execution of asynchronous chores (or tasks defined in ppltasks.h). Specifically, they manage their own lifetime by using reference counts. Scheduling a chore acquires a reference and on completion of its execution the reference is released.
|
delete |
|
private |
|
private |
|
inline |
Cancels work on the task collection.
|
privatevirtual |
Reimplemented from Concurrency::details::_RefCounterBase.
|
static |
Constructs a new task collection whose cancellation is governed by the specified cancellation token state.
_PTokenState | When this cancellation token is canceled, the task collection is canceled. |
|
private |
|
inline |
A cancellation friendly wrapper with which to execute _PChore and then waits for all chores running in the _TaskCollection to finish (normally or abnormally). This method encapsulates all the running tasks in an exception handling block, and will re-throw any exceptions that occur in any of it tasks (if those exceptions occur on another thread, they are marshaled from that thread to the thread where the _TaskCollection was created, and re-thrown). After this function returns, the _TaskCollection cannot be used for scheduling further work.
_PChore | An _UnrealizedChore which when non-null will be called to invoke the chore in a cancellation friendly manner. |
|
inline |
Schedule a chore with automatic inlining. The chore is pushed onto the associated workstealing queue, and will be executed in a LIFO order. The tasks scheduled into a _TaskCollection are scheduled into the current scheduler. Note that the specified chore can be scheduled only on a single task collection at a given time. Any attempt to schedule the same chore multiple times on one or more task collections will result in an invalid_multiple_scheduling exception. After the chore is guaranteed to have been executed (by calling the Wait method), it can be rescheduled to an arbitrary task collection. This schedule method will perform automatic inlining base on .
_PChore | The new unrealized chore need to be scheduled. The chore will be deleted after scheduling. |
_InliningMode | The inlining scheduling policy for current chore. |
|
delete |
|
private |