The Python Language: Multi-Processing

Python has built-in multiprocessing module in its standard library.

One simple example of using the Pool class is the following.

def myfunc(myfuncargs):
    'some thing here'

with Pool(10) as p:
    records =, myfuncargs)

However, there are limitations on this, especially on pickles. Another approach.

from multiprocessing import Pool
from multiprocessing.dummy import Pool as ThreadPool

with ThreadPool(1) as p:
    records =, myfuncargs)

Beware that map function will feed in a list of args to the function. So I have to use, [arg]) for one arg.

Planted: by ;

L Ma (2018). 'The Python Language: Multi-Processing', Datumorphism, 05 April. Available at: