Extensions for concurrency - cppreference.com

##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# Extensions for concurrency

From cppreference.com
< cpp‎ | experimental

The C++ Extensions for Concurrency, ISO/IEC TS 19571:xxxx, defines the following new components for the C++ standard library:

### [edit] Continuations and other extensions for std::future

Defined in header `<experimental/future>`
##### Continuations
(constructor) (concurrency TS) | unboxing constructor from future<future<T>> (public member function of `std::experimental::future`) [edit]
then (concurrency TS) | attaches a continuation to a future (public member function of `std::experimental::future`) [edit]
(constructor) (concurrency TS) | unboxing constructor from future<shared_future<T>> (public member function of `std::experimental::shared_future`) [edit]
then (concurrency TS) | attaches a continuation to a shared_future (public member function of `std::experimental::shared_future`) [edit]
##### Other enhancements
when_all (concurrency TS) | produces a future that becomes ready when all given futures or shared_futures are ready (function template) [edit]
when_any (concurrency TS) | produces a future that becomes ready when at least one of the given futures or shared_futures is ready (function template) [edit]
is_ready (concurrency TS) | checks if the shared state is ready (public member function of `std::experimental::future`) [edit]
is_ready (concurrency TS) | checks if the shared state is ready (public member function of `std::experimental::shared_future`) [edit]
make_ready_future (concurrency TS) | produces a future that is ready immediately and holds the given value (function template) [edit]
make_exceptional_future (concurrency TS) | produces a future that is ready immediately and holds the given exception (function template) [edit]

### [edit] Latches and barriers

Defined in header `<experimental/latch>`
latch (concurrency TS) | single-use thread barrier (class) [edit]
Defined in header `<experimental/barrier>`
barrier (concurrency TS) | reusable thread barrier (class) [edit]
flex_barrier (concurrency TS) | reusable thread barrier with customizable behavior on completion (class) [edit]

### [edit] Atomic smart pointers

These class templates replace the shared_ptr atomic function overloads

Defined in header `<experimental/atomic>`
atomic_shared_ptr (concurrency TS) | atomic version of std::shared_ptr (class template) [edit]
atomic_weak_ptr (concurrency TS) | atomic version of std::weak_ptr (class template) [edit]

### [edit] Feature test macros

Defined in header `<experimental/future>`
__cpp_lib_experimental_future_continuations | a value of at least 201505 indicates that future::then and other extensions are supported (macro constant)
Defined in header `<experimental/latch>`
__cpp_lib_experimental_latch | a value of at least 201505 indicates that the latch type is supported (macro constant)
Defined in header `<experimental/barrier>`
__cpp_lib_experimental_barrier | a value of at least 201505 indicates that barrier type is supported (macro constant)
Defined in header `<experimental/atomic>`
__cpp_lib_experimental_atomic_smart_pointers | a value of at least 201505 indicates that the atomic smart pointers are supported (macro constant)

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/experimental/concurrency&oldid=78870"