Fixing thread affinity