I work with the multiprocessing module in Python (2.7.3) and want to debug some things that happen to my workers. However, it seems like I cannot catch any exceptions in worker threads.
Minimal example:
import multiprocessing as mp a=[1] def worker(): print a[2] def pool(): pool = mp.Pool(processes=1) pool.apply_async(worker, args = ()) pool.close() pool.join() print "Multiprocessing done!" if __name__ == '__main__': pool()
An increase in IndexError is expected, but only my conclusion
Multiprocessing done!
Is there a way to show me all the exceptions that occur in worker threads without manually raising mine?
Dschoni
source share