26#ifndef MYSQLROUTER_IO_THREAD_AFFINITY_H
27#define MYSQLROUTER_IO_THREAD_AFFINITY_H
30#include <system_error>
35#elif defined(__FreeBSD__)
38#include <sys/cpuset.h>
51#if defined(__linux__) || defined(__FreeBSD__)
52 static constexpr const int max_cpus = CPU_SETSIZE;
54 static constexpr const int max_cpus = 64;
56 static constexpr const int max_cpus = 1024;
72 stdx::expected<
std::bitset<max_cpus>,
std::error_code> affinity()
76 stdx::expected<
void,
std::error_code> affinity(
manage thread affinity.
Definition: thread_affinity.h:49
ThreadAffinity(native_handle_type thread_id) noexcept
Definition: thread_affinity.h:65
pthread_t native_handle_type
Definition: thread_affinity.h:62
#define IO_COMPONENT_EXPORT
Definition: io_component_export.h:15
static my_thread_id thread_id
Definition: my_thr_init.cc:60
noexcept
The return type for any call_and_catch(f, args...) call where f(args...) returns Type.
Definition: call_and_catch.h:76
int native_handle_type
Definition: socket_constants.h:51
Define std::hash<Gtid>.
Definition: gtid.h:355
#define HANDLE
Definition: violite.h:159