HPX - High Performance ParalleX

PrevUpHomeNext

Function template wait_any

hpx::wait_any

Synopsis

// In header: <hpx/lcos/wait_any.hpp>


template<typename... T> void wait_any(error_code & ec, T &&... futures);

Description

The function wait_any is a non-deterministic choice operator. It OR-composes all future objects given and returns the same list of futures after one future of that list finishes execution.

[Note] Note

The function wait_any returns after at least one future has become ready. All input futures are still valid after wait_any returns.

As long as ec is not pre-initialized to hpx::throws this function doesn't throw but returns the result code using the parameter ec. Otherwise it throws an instance of hpx::exception.

None of the futures in the input sequence are invalidated.

Parameters:

ec

[in,out] this represents the error status on exit, if this is pre-initialized to hpx::throws the function will throw on error instead.

futures

[in] An arbitrary number of future or shared_future objects, possibly holding different types for which wait_any should wait.


PrevUpHomeNext