CPU affinity, also called CPU pinning, enables the binding of a process or a thread to a specific CPU core, or CPU cores. The following function is provided as a standard library to set affinity. [reference] #include int sched_setaffinity(pid_t pid, size_t cpusetsize, cpu_set_t *mask); int sched_getaffinity(pid_t pid, size_t cpusetsize, cpu_set_t *mask); On success, schedu_setaffinity() and sched_getaffinity() return 0. On error, -1 is returned, and errno is set appropriately. cpu_set_t can ...