Set affinity for each thread