35 using std::numeric_limits;
36 using ret_int_t = uint16_t;
41 return ret_int_t(sched_getcpu());
42#elif defined(FLOW_OS_MAC)
46 __cpuid_count(1, 0, cpu_info[0], cpu_info[1], cpu_info[2], cpu_info[3]);
47 if ((cpu_info[3] & (1 << 9)) == 0)
52 const auto idx = cpu_info[1] >> 24;
53 assert(idx <= numeric_limits<ret_int_t>::max());
54 return ret_int_t(idx);
56# error "cpu_idx() implementation is for Linux or Mac only. Mac way'd likely work in any x86, but that's untested."
Flow module containing tools enabling multi-threaded event loops operating under the asynchronous-tas...
uint16_t cpu_idx()
Returns the 0-based processor logical (not hardware) core index of the core executing the calling thr...