No, the filter is applied to the whole process and threads can move between (the restricted list of) cores. If you want threads not to move, then you need set the affinity of each thread separately (eg. using pthread_setaffinity_np
for example). Note that you can check the affinity of threads of a given process with the great hwloc tool (hwloc-ps -t
).
Note that some libraries/frameworks have ways to do that more easily. This is the case for OpenMP programs where you can use environment variables like OMP_PLACES
to set the affinity of each thread.