GrPPI
1.0
Generic and Reusable Parallel Pattern Interface
|
Thread index table to provide portable natural thread indices. More...
#include <parallel_execution_native.h>
Public Member Functions | |
thread_registry ()=default | |
void | register_thread () noexcept |
Adds the current thread id in the registry. More... | |
void | deregister_thread () noexcept |
Removes current thread id from the registry. More... | |
int | current_index () const noexcept |
Integer index for current thread. More... | |
Thread index table to provide portable natural thread indices.
A thread table provides a simple way to offer thread indices (starting from 0).
When a thread registers itself in the registry, its id is added to the vector of identifiers. When a thread deregisters itself from the registry its entry is modified to contain the empty thread id.
To get an integer index, users may call current_index
, which provides the order number of the calling thread in the registry.
|
default |
|
inlinenoexcept |
Integer index for current thread.
|
inlinenoexcept |
Removes current thread id from the registry.
|
inlinenoexcept |
Adds the current thread id in the registry.