9#if HI_OPERATING_SYSTEM == HI_OS_WINDOWS
19namespace hi::inline
v1 {
21#if HI_OPERATING_SYSTEM == HI_OS_WINDOWS
23#elif HI_OPERATING_SYSTEM == HI_OS_LINUX || HI_OPERATING_SYSTEM == HI_OS_MACOS
24constexpr std::size_t maximum_num_cpus = CPU_SETSIZE;
27#if HI_OPERATING_SYSTEM == HI_OS_WINDOWS
28using thread_id = uint32_t;
30using thread_id = uint64_t;
33inline thread_local thread_id current_thread_id_dummy = 0;
41#if HI_OPERATING_SYSTEM == HI_OS_WINDOWS
43 constexpr uint64_t NT_TIB_CurrentThreadID = 0x48;
44 return __readgsdword(NT_TIB_CurrentThreadID);
47 return reinterpret_cast<uint64_t
>(¤t_thread_id_dummy);
86std::vector<
bool> set_thread_affinity_mask(
std::vector<
bool> const &mask);
97std::vector<
bool> set_thread_affinity(
std::
size_t cpu_id);
108std::
size_t advance_thread_affinity(
std::
size_t &cpu) noexcept;
114[[nodiscard]]
std::
size_t current_cpu_id() noexcept;
Utilities used by the HikoGUI library itself.
Functions and macros for handling architectural difference between compilers, CPUs and operating syst...
DOXYGEN BUG.
Definition algorithm.hpp:15
std::string get_thread_name(thread_id id) noexcept
Get the thread name of a thread id.
void set_thread_name(std::string_view name) noexcept
Set the name of the current thread.
std::vector< bool > process_affinity_mask() noexcept
Get the current process CPU affinity mask.
thread_id current_thread_id() noexcept
Get the current thread id.
Definition thread.hpp:39