You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following snippet of code does not do what I would expect it to do:
void fun1(int, shared_future<void>) {...}
int fun2(int, shared_future<void>) {...}
...
{
shared_future<void> f = ...;
std::vector<int> v(100);
// tested with exec as pool_executor, thread_pool_executor or this_thread_executor
bulk_then_execute(exec, &fun1, v, f); // Returns future<void>
// bulk_then_execute(exec, &fun2, v, f); // Does not compile
}
Expected Behavior
with fun1 I expect either that .get()ing the future<void> would block until all 100 invocations of fun1 have finished or that it returns a vector<future<void>> like bulk_async_execute
with fun2 I expect it to compile and return a vector<future<int>>
Actual Behavior
with fun1get() does not wait for all invocations to finish
with fun2 it fails to compile with the following error:
/home/simbergm/src/hpx-worktrees/fix-examples/hpx/parallel/executors/thread_execution.hpp:213:25: error: could not convert ‘hpx::traits::future_access<hpx::lcos::future<R>>::create(boost::intrusive_ptr<U>&&) [with SharedState = hpx::lcos::detail::future_data_base<std::vector<hpx::lcos::future<int>, std::allocator<hpx::lcos::future<int> > > >; R = std::vector<hpx::lcos::future<int>, std::allocator<hpx::lcos::future<int> > >]()’ from ‘hpx::lcos::future<std::vector<hpx::lcos::future<int>, std::allocator<hpx::lcos::future<int> > > >’ to ‘std::enable_if<true, hpx::lcos::future<std::vector<int> > >::type {aka hpx::lcos::future<std::vector<int> >}’
std::move(p));
^
The following snippet of code does not do what I would expect it to do:
Expected Behavior
fun1
I expect either that.get()
ing thefuture<void>
would block until all 100 invocations offun1
have finished or that it returns avector<future<void>>
likebulk_async_execute
fun2
I expect it to compile and return avector<future<int>>
Actual Behavior
fun1
get()
does not wait for all invocations to finishfun2
it fails to compile with the following error:Specifications
The text was updated successfully, but these errors were encountered: