On my Macbook Pro (Intel, 2020) I can successfully use multiprocessing.Pool like:
from multiprocessing import Pool
p = Pool(8)
results = p.map(worker_function, list_of_inputs)
p.close()
However, if I run the same code on my Macbook Air (M1, 2020), I get a strange error repeated again and again (snippet below):
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.