Deadlock problem using multiprocessing
bluegene8210 at gmail.com
Sun Sep 11 17:46:40 CEST 2011
> I get this exception when I run the first program:
> Exception in thread Thread-1:
> Traceback (most recent call last):
> File "/usr/lib/python3.1/threading.py", line 516, in _bootstrap_inner
> File "/usr/lib/python3.1/threading.py", line 469, in run
> self._target(*self._args, **self._kwargs)
> File "/usr/lib/python3.1/multiprocessing/pool.py", line 231, in _handle_tasks
> File "/usr/lib/python3.1/pickle.py", line 1349, in dumps
> Pickler(f, protocol, fix_imports=fix_imports).dump(obj)
> _pickle.PicklingError: Can't pickle <class 'method'>: attribute lookup
> builtins.method failed
> There is no deadlock. You are hitting this problem:http://stackoverflow.com/questions/1816958/cant-pickle-type-instancem...
You're right. I just realized that I was running the program through
my Vim plug-in which would use the subprocess module to open the
process, wait for its termination and get the output. It seems that
multi-process program would act quite differently such that my Vim
plug-in had been halted without getting any error information, so I
was to falsely take it as a deadlock.
The thread in stackoverflow you referenced is great, now I'm trying to
fit the solution in my own program, thanks a lot!
More information about the Python-list