hpx::register_thread, hpx::unregister_thread, hpx::get_os_thread_data, hpx::enumerate_os_threads, hpx::get_runtime_instance_number, hpx::register_on_exit, hpx::is_starting, hpx::tolerate_node_faults, hpx::is_running, hpx::is_stopped, hpx::is_stopped_or_shutting_down, hpx::get_num_worker_threads, hpx::get_system_uptime#

Defined in header hpx/runtime.hpp.

See Public API for a list of names and headers that are part of the public HPX API.

namespace hpx

Functions

bool register_thread(runtime *rt, char const *name, error_code &ec = throws)#

Register the current kernel thread with HPX, this should be done once for each external OS-thread intended to invoke HPX functionality. Calling this function more than once will return false.

void unregister_thread(runtime *rt)#

Unregister the thread from HPX, this should be done once in the end before the external thread exists.

runtime_local::os_thread_data get_os_thread_data(std::string const &label)#

Access data for a given OS thread that was previously registered by register_thread. This function must be called from a thread that was previously registered with the runtime.

bool enumerate_os_threads(hpx::function<bool(os_thread_data const&)> const &f)#

Enumerate all OS threads that have registered with the runtime.

std::size_t get_runtime_instance_number()#

Return the runtime instance number associated with the runtime instance the current thread is running in.

bool register_on_exit(hpx::function<void()> const&)#

Register a function to be called during system shutdown.

bool is_starting()#

Test whether the runtime system is currently being started.

This function returns whether the runtime system is currently being started or not, e.g. whether the current state of the runtime system is hpx::state::startup

Note

This function needs to be executed on a HPX-thread. It will return false otherwise.

bool tolerate_node_faults()#

Test if HPX runs in fault-tolerant mode.

This function returns whether the runtime system is running in fault-tolerant mode

bool is_running()#

Test whether the runtime system is currently running.

This function returns whether the runtime system is currently running or not, e.g. whether the current state of the runtime system is hpx::state::running

Note

This function needs to be executed on a HPX-thread. It will return false otherwise.

bool is_stopped()#

Test whether the runtime system is currently stopped.

This function returns whether the runtime system is currently stopped or not, e.g. whether the current state of the runtime system is hpx::state::stopped

Note

This function needs to be executed on a HPX-thread. It will return false otherwise.

bool is_stopped_or_shutting_down()#

Test whether the runtime system is currently being shut down.

This function returns whether the runtime system is currently being shut down or not, e.g. whether the current state of the runtime system is hpx::state::stopped or hpx::state::shutdown

Note

This function needs to be executed on a HPX-thread. It will return false otherwise.

std::size_t get_num_worker_threads()#

Return the number of worker OS- threads used to execute HPX threads.

This function returns the number of OS-threads used to execute HPX threads. If the function is called while no HPX runtime system is active, it will return zero.

std::uint64_t get_system_uptime()#

Return the system uptime measure on the thread executing this call.

This function returns the system uptime measured in nanoseconds for the thread executing this call. If the function is called while no HPX runtime system is active, it will return zero.

namespace threads