hpx::thread#
Defined in header hpx/thread.hpp.
See Public API for a list of names and headers that are part of the public HPX API.
See also:
-
class thread#
The class thread represents a single thread of execution. Threads allow multiple functions to execute concurrently. Threads begin execution immediately upon construction of the associated thread object (pending any OS scheduling delays), starting at the top-level function provided as a constructor argument. The return value of the top-level function is ignored and if it terminates by throwing an exception, hpx::terminate is called. The top-level function may communicate its return value or an exception to the caller via hpx::promise or by modifying shared variables (which may require synchronization, see hpx::mutex and hpx::atomic) hpx::thread objects may also be in the state that does not represent any thread (after default construction, move from, detach, or join), and a thread of execution may not be associated with any thread objects (after detach). No two hpx::thread objects may represent the same thread of execution; hpx::thread is not CopyConstructible or CopyAssignable, although it is MoveConstructible and MoveAssignable.