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()#
-
template<typename E, typename TaskOrFunc>
void tmc::post(E &Executor, TaskOrFunc &&Work, size_t Priority = 0, size_t ThreadHint = NO_HINT) noexcept# Submits
Workfor execution onExecutorat priorityPriority. Tasks or functors that return values cannot be submitted this way; seepost_waitableinstead.
-
inline size_t tmc::current_thread_index() noexcept#
Returns the current thread’s index within its executor. Each executor’s threads are numbered independently, starting from 0. Returns -1 if this thread is not associated with an executor.