Just don't. Most of the time, when you think it helps, it just makes them worse.
Each restriction that you place in the system has a cost. The scheduler is very smart, and the more restrictions you impose on it, the worse it will work. The scheduler will not move the thread from one core to another unless it has a good reason.
source share