sturlamolden wrote: > On 18 Aug, 11:41, Stefan Behnel <stefan...@behnel.de> wrote: > >> I think the canonical answer is to use the threading module or >> (preferably) the multiprocessing module, which is new in Py2.6. >> >> http://docs.python.org/library/threading.htmlhttp://docs.python.org/library/multiprocessing.html >> >> Both share a (mostly) common interface and are simple enough to use. They >> are pretty close to the above interface already. > > There is a big difference between them, which is that multiprocessing > do not work with closures. This means that the threading module is > simpler to use than multiprocessing if you want to parallelize serial > code. You just wrap a closure around whatever block of code you want > to run in a thread.
Do you have an example of this technique? -- http://mail.python.org/mailman/listinfo/python-list