HPX - High Performance ParalleX

PrevUpHomeNext

Function get_worker_thread_num

hpx::get_worker_thread_num — Return the number of the current OS-thread running in the runtime instance the current HPX-thread is executed with.

Synopsis

// In header: <hpx/hpx_fwd.hpp>


std::size_t get_worker_thread_num();

Description

This function returns the zero based index of the OS-thread which executes the current HPX-thread.

[Note] 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().

This function needs to be executed on a HPX-thread. It will fail otherwise (it will return -1).


PrevUpHomeNext