I recently wrote some code[1][2] that tried using JNA to make calls to sched_setaffinity
in an attempt to set the affinity of the process to a particular core. The first argument of the function sched_setaffinity
is the process id.
Calling the function with pid as 0(referring to the process itself) works fine. However, I'd like to be able to set the affinity on a thread id basis rather than the process. Is there any way I could do that?