3 ms·
You could certainly limit the process pool in the multiprocessing library itself: https://docs.python.org/2/library/multiprocessing.html https://docs.python.org
by gshulegaard 10y ago
You could certainly limit the process pool in the multiprocessing library itself: https://docs.python.org/2/library/multiprocessing.html https://docs.python.org/2/library/multiprocessing.html ... but it doesn't seem like this decorator abstraction accounts for it.
> That's it, two lines of changes is all we need in order to parallelize this program. Now this program will make use of all the cores on the machine it's running on, allowing it to run significantly faster.
> As an overview, DECO is mainly just a smart wrapper for Python's multiprocessing.pool. When @concurrent is applied to a function it replaces it with calls to pool.apply_async. Additionally when arguments are passed to pool.apply_async, DECO replaces any index mutable objects with proxies, allowing it to detect and synchronize mutations of these objects. The results of these calls can then be obtained by calling wait() on the concurrent function, invoking a synchronization event.
I haven't really dug around the source code, but it sounds like not really.