12#include "../utility/utility.hpp"
13#include "../macros.hpp"
21#include <unordered_map>
25hi_export_module(hikogui.concurrency.thread : intf);
27hi_export
namespace hi {
inline namespace v1 {
31hi_inline unfair_mutex thread_names_mutex = {};
64 auto const lock = std::scoped_lock(detail::thread_names_mutex);
65 auto const it = detail::thread_names.find(
id);
66 if (
it != detail::thread_names.
end()) {
69 return std::format(
"{}",
id);
Definition of the unfair_mutex.
std::vector< bool > process_affinity_mask()
Get the current process CPU affinity mask.
hi_inline std::string get_thread_name(thread_id id) noexcept
Get the thread name of a thread id.
Definition thread_intf.hpp:62
void set_thread_name(std::string_view name) noexcept
Set the name of the current thread.
std::vector< bool > set_thread_affinity_mask(std::vector< bool > const &mask)
Set the current thread CPU affinity mask.
std::size_t current_cpu_id() noexcept
Get the current CPU id.
hi_inline std::vector< bool > set_thread_affinity(std::size_t cpu_id)
Set the current thread CPU affinity to a single CPU.
Definition thread_intf.hpp:103
hi_inline std::size_t advance_thread_affinity(std::size_t &cpu) noexcept
Advance thread affinity to the next CPU.
Definition thread_intf.hpp:121
thread_id current_thread_id() noexcept
Get the current thread id.
@ end
Start from the end of the file.
DOXYGEN BUG.
Definition algorithm_misc.hpp:20
The HikoGUI namespace.
Definition recursive_iterator.hpp:15
hi_inline cpu_id_result cpu_id(uint32_t leaf_id, uint32_t index=0) noexcept
A generic x86 cpu-id instruction.
Definition cpu_id_x86.hpp:347
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:378
Exception thrown during an operating system call.
Definition exception_intf.hpp:184