Skip to content Skip to sidebar Skip to footer

Python Multiprocessing And Number Of Cores

I have a mac , and it has 2 physical cores and 4 logical cores. I am trying to figure out the python multiprocessing . As far as I know, each process in the processing uses one co

Solution 1:

You can start as many processes from your Python script as you like and the operating system scheduler will schedule them to run on your CPU cores. If those processes are CPU bound, then you won't get better performance by starting more processes than cores. But in your example, the processes are spending most of their time sleeping, and therefore they aren't competing for the cores, which is why 8 processes can run in the same time as 4.


Post a Comment for "Python Multiprocessing And Number Of Cores"