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
Work
for execution onExecutor
at priorityPriority
. Tasks or functors that return values cannot be submitted this way; seepost_waitable
instead.
-
inline size_t tmc::current_thread_index() noexcept#
Returns the current thread’s index within its executor. Returns -1 if this thread is not associated with an executor.