carb/thread/Util.h¶
↰ Parent directory: carb/thread/
Carbonite thread utilities.
Source: carb/thread/Util.h
Included By¶
omni/log/ILog.h: Fast, multi-channel logging.
carb/tasking/TaskingUtils.h: carb::tasking utilities.
carb/container/LocklessQueue.h: Defines the LocklessQueue class.
carb/thread/Mutex.h: Carbonite mutex and recursive_mutex implementation.
carb/container/LocklessStack.h: Defines the LocklessStack class.
carb/delegate/Delegate.h: Carbonite Delegate implementation.
Namespaces¶
carb: The main Carbonite namespace.
carb::this_thread: Namespace for utilities that operate on the current thread specifically.
carb::thread: Namespace for all threading operations.
Functions¶
carb::this_thread::get: Returns the native handle for the current thread.
carb::this_thread::getAffinity: Gets the current CPU Affinity for the current thread.
carb::this_thread::getId: Retrieve the thread ID for the current thread.
carb::this_thread::getName: Retrieves the name of the current thread.
carb::this_thread::getProcessId: Returns the ID of the currently executing process.
carb::this_thread::getProcessIdCached: Get the ID of the currently executing process.
carb::this_thread::setAffinity: Sets the affinity of the current thread.
carb::this_thread::setAffinity: Sets the CPU Affinity for the current thread.
carb::this_thread::setName: Sets the name for the current thread.
carb::this_thread::sleepForUs: A simple sleep for the current thread that does not include the overhead of
std::chrono
.carb::this_thread::spinTryWait: Calls a predicate until it returns true or a random number of attempts have elapsed.
carb::this_thread::spinWait: Calls a predicate repeatedly until it returns
true
.carb::this_thread::spinWaitWithBackoff: Calls a predicate until it returns true with progressively increasing delays between calls.
carb::thread::getAffinity: Gets the current CPU Affinity for the thread.
carb::thread::getName: Retrieves the name of the thread previously set with carb::thread::setName.
carb::thread::hardware_concurrency: Similar to
std::thread::hardware_concurrency()
, but pays attention to docker cgroup config and CPU limits.carb::thread::setAffinity: Sets the CPU affinity for the given thread handle.
carb::thread::setAffinity: Sets the CPU Affinity for the thread.
carb::thread::setName: Sets the name of the given thread.
Defines¶
OMNI_PRItid: The printf format macro to print a thread ID.
OMNI_PRIxtid: The printf format macro to print a thread ID in hexidecimal.
Typedefs¶
carb::thread::CpuMaskVector: Each entry in the vector is a bitmask for a set of CPUs.
carb::thread::ProcessId: The type for a process ID.
carb::thread::ThreadId: The type for a thread ID.
Variables¶
carb::thread::kCpusPerMask: The number of Cpus represented by an individual cpu mask.