Problem with multiprocessing

Tennessee tleeuwenburg at gmail.com
Fri Sep 4 07:48:16 CEST 2009


> Yes, to use the multiprocessing module, you must make your script
> importable, so runtime statements should go into a __main__
> conditional.  This way, when multiprocessing imports the module for each
> of its threads, the actual runtime code only gets executed once in the
> parent thread, which has the lock.  At least, that is what I think is
> happening.

Oh, that makes total sense. Thanks to both of you!

-T



More information about the Python-list mailing list