HPX - High Performance ParalleX

PrevUpHomeNext

Function template wait_some

hpx::wait_some

Synopsis

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


template<typename R> 
  void wait_some(std::size_t n, std::vector< future< R >> && futures, 
                 error_code & ec = throws);

Description

The function wait_some is an operator allowing to join on the result of all given futures. It AND-composes all future objects given and returns a new future object representing the same list of futures after n of them finished executing.

[Note] Note

The function wait_all returns after n futures have become ready. All input futures are still valid after wait_all returns.

Each future and shared_future is waited upon and then copied into the collection of the output (returned) future, maintaining the order of the futures in the input collection. The future returned by wait_some will not throw an exception, but the futures held in the output collection may.

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] A vector holding an arbitrary amount of future or shared_future objects for which wait_some should wait.

n

[in] The number of futures out of the arguments which have to become ready in order for the returned future to get ready.


PrevUpHomeNext