Can i bind python thread to certain cores?

Viewed 361

I'm writing a python program which starts multiple process by using multiprocess module. One of those process start multiple threads by using threading module. I have used psutil.cpu_affinity to bind those process to certain cores, one core for each process. But I have found that the process with multi-thread doesn't get bounded to its corresponding core. On the contrary, according to the result shown by "taskset", it can use all the cores. I wonder if I can bind the process with multiple threads into only one core?

0 Answers
Related