I am currently trying to use python multiprocessing. The library I use is multiprocess
(NOT multiprocessing
).
I have the following code, which creates a number of computing jobs, and runs it through a map operation:
pool = multiprocess.Pool(4)
all_responses = pool.map_async(wrapper_singlerun, range(10000))
pool.join()
pool.close()
However, whenever I run this snippet of code, I get the following error:
pool.join()
File "/Users/davidal/miniconda3/lib/python3.6/site-packages/multiprocess/pool.py", line 509, in join
assert self._state in (CLOSE, TERMINATE)
AssertionError
Do you have any idea why this error happens? I used pool.map_async
before, but figured that I need to have a pool rendez-vous
command. Otherwise, my PC created something like a forkbomb, which created too many threads (at least, that's what I think it does...)
Any ideas are appreciated!