HPX - High Performance ParalleX

PrevUpHomeNext

Function template wait_any_n

hpx::wait_any_n

Synopsis

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


template<typename InputIter> 
  InputIter wait_any_n(InputIter first, std::size_t count, 
                       error_code & ec = throws);

Description

The function wait_any_n 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_n returns after at least one future has become ready. All input futures are still valid after wait_any_n returns.

[Note] Note

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:

count

[in] The number of elements in the sequence starting at first.

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_n should wait.

Returns:

The function wait_all_n will return an iterator referring to the first element in the input sequence after the last processed element.


PrevUpHomeNext