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?
Asked
Active
Viewed 460 times
4
-
Does this answer your question? [How to limit the number of processors that Python uses](https://stackoverflow.com/questions/5495203/how-to-limit-the-number-of-processors-that-python-uses) – Rambatino Jun 21 '20 at 12:00