pthread affinity

I can create and run threads using pthread_create() as long as I don’t call pthread_attr_setaffinity_np() to select which core to run the thread on. If I do that then I get back EINVAL indicating that it’s invalid input. This is code that runs successfully on other LINUX platforms. Has anyone seen this problem?


It might depend on what the thread does, e.g., hardware I/O. It might also depend on which core you specify since some cores may not be online (run “sudo nvpmodel -m 0” to know all cores are online). Also, you might need root permission to set affinity (e.g., via sudo). If you have a demo program you might post it (there is a “code” icon in the upper right while posting…the “</>” symbol…click that, and then paste the code inside of the “</>” content).