HPX - High Performance ParalleX

PrevUpHomeNext

Function template wait_any

hpx::wait_any

Synopsis

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


template<typename InputIter> 
  void wait_any(InputIter first, InputIter last, error_code & ec = throws);

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.

first

[in] The iterator pointing to the first element of a sequence of future or shared_future objects for which wait_any should wait.

last

[in] The iterator pointing to the last element of a sequence of future or shared_future objects for which wait_any should wait.


PrevUpHomeNext