task_group Class
This page is specific to:.NET Framework Version:4.0
Visual Studio 2010 - Visual C++
task_group Class

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Represents a collection of parallel work which can be waited upon or canceled.

class task_group;
Members

Public Constructors

Name

Description

task_group::~task_group Destructor

Destructs a task_group. Note that it is expected that the wait() method has been called and no more work is queued prior to the destructor. The destructor running with work queued will result in an immediate exception.

task_group::task_group Constructor

Constructs a new task_group

Public Methods

Name

Description

task_group::cancel Method

Makes a best effort attempt to cancel the sub-tree of work rooted at this task group. Every work item scheduled upon the task group will get canceled transitively if possible.

task_group::is_canceling Method

Informs the caller whether or not the task group is currently in the midst of a cancellation. Note that this does not necessarily indicate that cancel was called on the group (although such certainly qualifies this function to return true). It may be the case that the task group is executing inline and a task group further up in the work tree was canceled. In cases such as these where we can determine ahead of time that cancellation will flow through this group, true will be returned as well.

task_group::run Method

Overloaded.

task_group::run_and_wait Method

Overloaded. Schedules a work item to be run inline with the assistance of the task_group for full cancellation support. The caller manages lifetime of the all objects. Then wait until all work on the task_group has completed or is canceled. Once the wait has returned, the structured_task_group is considered in a final state and should not be used.

task_group::wait Method

Waits until all work on the task_group has completed or is canceled. Calling this has the effect of resetting the task group to a clean state where it can be reused (including after cancellation).

Remarks

For more information, see Task Parallelism.

Inheritance Hierarchy

Concurrency::task_group

Requirements

Header: ppl.h

See Also

Reference

© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View