The ThreadHint parameter can be used to request, but not guarantee, that a task executes on a particular thread. The value passed should be the integer index in range [0..ThreadCount) of the thread in that executor. You can retrieve the current thread index using tmc::current_thread_index().

tmc::post_bulk_waitable()#

Overloads for tmc::task<void>:

template<typename E, typename TaskIter, typename Task = std::iter_value_t<TaskIter>>
std::future<void> tmc::post_bulk_waitable(E &&Executor, TaskIter &&Begin, size_t Count, size_t Priority = 0, size_t ThreadHint = NO_HINT)#

Iter must be an iterator type that exposes task<void> operator*() and Iter& operator++().

Submits items in range [Begin, Begin + Count) to the executor at priority Priority. The return value is a std::future<void> that can be used to poll or blocking wait for all of the tasks to complete.

Bulk waitables only support void return; if you want to return values, preallocate a result array and capture a reference to it in your tasks.

template<typename E, typename TaskIter, typename Task = std::iter_value_t<TaskIter>>
std::future<void> tmc::post_bulk_waitable(E &&Executor, TaskIter &&Begin, TaskIter &&End, size_t Priority = 0, size_t ThreadHint = NO_HINT)#

Iter must be an iterator type that exposes task<void> operator*() and Iter& operator++().

Submits items in range [Begin, End) to the executor at priority Priority. The return value is a std::future<void> that can be used to poll or blocking wait for all of the tasks to complete.

Bulk waitables only support void return; if you want to return values, preallocate a result array and capture a reference to it in your tasks.

template<typename E, typename TaskRange, typename TaskIter = tmc::detail::range_iter<TaskRange>::type, typename Task = std::iter_value_t<TaskIter>>
std::future<void> tmc::post_bulk_waitable(E &&Executor, TaskRange &&Range, size_t Priority = 0, size_t ThreadHint = NO_HINT)#

TaskRange must implement begin() and end() functions which return an iterator type. The iterator type must implement task<void> operator*() and Iter& operator++().

Submits items in range [Range.begin(), Range.end()) to the executor at priority Priority. The return value is a std::future<void> that can be used to poll or blocking wait for all of the tasks to complete.

Bulk waitables only support void return; if you want to return values, preallocate a result array and capture a reference to it in your tasks.

Overloads for void-returning functors:

template<typename E, typename FuncIter, typename Functor = std::iter_value_t<FuncIter>>
std::future<void> tmc::post_bulk_waitable(E &&Executor, FuncIter &&Begin, size_t Count, size_t Priority = 0, size_t ThreadHint = NO_HINT)#

FuncIter must be an iterator type that exposes Functor operator*() and FuncIter& operator++(). Functor must expose void operator(). Submits items in range [Begin, Begin + Count) to the executor at priority Priority. The return value is a std::future<void> that can be used to poll or blocking wait for the result to be ready.

Bulk waitables only support void return; if you want to return values, preallocate a result array and capture a reference to it in your tasks.

template<typename E, typename FuncIter, typename Functor = std::iter_value_t<FuncIter>>
std::future<void> tmc::post_bulk_waitable(E &&Executor, FuncIter &&Begin, FuncIter &&End, size_t Priority = 0, size_t ThreadHint = NO_HINT)#

FuncIter must be an iterator type that exposes Functor operator*() and FuncIter& operator++(). Functor must expose void operator().

Submits items in range [Begin, End) to the executor at priority Priority. The return value is a std::future<void> that can be used to poll or blocking wait for the result to be ready.

Bulk waitables only support void return; if you want to return values, preallocate a result array and capture a reference to it in your tasks.

template<typename E, typename FuncRange, typename FuncIter = tmc::detail::range_iter<FuncRange>::type, typename Functor = std::iter_value_t<FuncIter>>
std::future<void> tmc::post_bulk_waitable(E &&Executor, FuncRange &&Range, size_t Priority = 0, size_t ThreadHint = NO_HINT)#

TaskRange must implement begin() and end() functions which return an iterator type. The iterator type must implement task<void> operator*() and Iter& operator++().

Submits items in range [Range.begin(), Range.end()) to the executor at priority Priority. The return value is a std::future<void> that can be used to poll or blocking wait for all of the tasks to complete.

Bulk waitables only support void return; if you want to return values, preallocate a result array and capture a reference to it in your tasks.