carb::thread::setAffinity

Defined in carb/thread/Util.h

inline void carb::thread::setAffinity(NativeHandleType h, size_t mask)

Sets the CPU affinity for the given thread handle.

Each bit represents a logical CPU; bit 0 for CPU 0, bit 1 for CPU 1, etc.

Parameters
  • h – The native handle to the thread

  • mask – The bitmask representing the desired CPU affinity. Zero (no bits set) is ignored.