A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2018-October/155439.html below:

[Python-Dev] bpo-34837: Multiprocessing.Pool API Extension

[Python-Dev] bpo-34837: Multiprocessing.Pool API Extension - Pass Data to Workers w/o Globals [Python-Dev] bpo-34837: Multiprocessing.Pool API Extension - Pass Data to Workers w/o GlobalsNathaniel Smith njs at pobox.com
Thu Oct 4 06:15:31 EDT 2018
On Wed, Oct 3, 2018 at 6:30 PM, Sean Harrington <seanharr11 at gmail.com> wrote:
> with Pool(func_kwargs={"big_cache": big_cache}) as pool:
>     pool.map(func, ls)

I feel like it would be nicer to spell this:

with Pool() as pool:
    pool.map(functools.partial(func, big_cache=big_cache), ls)

And this might also solve your problem, if pool.map is clever enough
to only send the function object once to each worker?

-n

-- 
Nathaniel J. Smith -- https://vorpus.org
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4