Multiprocessing Pool使用apply_async()时报错

使用python的multiprocessing pool的apply_async()时,经常crash:

Traceback (most recent call last):
  File "/usr/lib64/python2.7/threading.py", line 812, in __bootstrap_inner
    self.run()
  File "/usr/lib64/python2.7/threading.py", line 765, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib64/python2.7/multiprocessing/pool.py", line 342, in _handle_tasks
    put(task)
RuntimeError: dictionary changed size during iteration

这个问题在python 2.7.10版本之后被修复:

https://bugs.python.org/issue23051

你可能感兴趣的:(Multiprocessing Pool使用apply_async()时报错)