MCPcopy Create free account
hub / github.com/bshoshany/thread-pool / submit_loop

Function submit_loop

include/BS_thread_pool.hpp:1904–1907  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1902 */
1903 template <typename T1, typename T2, typename T = common_index_type_t<T1, T2>, typename F>
1904 [[nodiscard]] multi_future<void> submit_loop(const T1 first_index, const T2 index_after_last, F&& loop, const std::size_t num_blocks = 0, const priority_t priority = 0)
1905 {
1906 return enqueue_loop<T, F, true>(static_cast<T>(first_index), static_cast<T>(index_after_last), std::forward<F>(loop), num_blocks, priority);
1907 }
1908
1909 /**
1910 * @brief Submit a sequence of tasks enumerated by indices to the queue, with the specified priority. The sequence function takes one argument, the task index, and will be called once per index. If the sequence function has a return value, get a `BS::multi_future` for the eventual returned values. If the sequence function has no return value, get a `BS::multi_future<void>` which can be used to wait until all the tasks finish.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected