hpx::get_worker_thread_num#
Defined in header hpx/runtime.hpp.
See Public API for a list of names and headers that are part of the public HPX API.
See also:
-
std::size_t hpx::get_worker_thread_num() noexcept#
Return the number of the current OS-thread running in the runtime instance the current HPX-thread is executed with.
This function returns the zero based index of the OS-thread which executes the current HPX-thread.
Note
The returned value is zero based and its maximum value is smaller than the overall number of OS-threads executed (as returned by get_os_thread_count()).
Note
This function needs to be executed on a HPX-thread. It will fail otherwise (it will return -1).
-
std::size_t hpx::get_worker_thread_num(error_code &ec) noexcept#
Return the number of the current OS-thread running in the runtime instance the current HPX-thread is executed with.
This function returns the zero based index of the OS-thread which executes the current HPX-thread.
Note
The returned value is zero based and its maximum value is smaller than the overall number of OS-threads executed (as returned by get_os_thread_count()). It will return -1 if the current thread is not a known thread or if the runtime is not in running state.
Note
This function needs to be executed on a HPX-thread. It will fail otherwise (it will return -1).
- Parameters:
ec – [in,out] this represents the error status on exit (obsolete, ignored).