Yes - “func” (and “self” which func is bound to) would be copied to each child worker process, where they are stored and applied to each element of the iterable being mapped over.<br><div class="gmail_quote"><div dir="ltr">On Fri, Oct 12, 2018 at 10:41 AM Antoine Pitrou <<a href="mailto:solipsis@pitrou.net">solipsis@pitrou.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, 12 Oct 2018 09:42:50 -0400<br>
Sean Harrington <<a href="mailto:seanharr11@gmail.com" target="_blank">seanharr11@gmail.com</a>> wrote:<br>
> I would contend that this is much more granular than Dask - this is just an<br>
> optimization of Pool.map() to avoid redundantly passing the same `func`<br>
> repeatedly, once per task, to each worker, with the primary goal of<br>
> eliminating redundant serialization of large-memory-footprinted Callables.<br>
> This is a different use case than Dask - I don't intend to approach the<br>
> shared memory or distributed computing realms.<br>
> <br>
> And the second call to Pool.map would update the cached "self" as a part of<br>
> its initialization workflow, s.t. "the latest version of self when map() is<br>
> called is taken into account".<br>
<br>
I still don't understand how that works.  If you "updated the cached<br>
self", then surely you must transmit it to the child, right?<br>
<br>
Regards<br>
<br>
Antoine.<br>
<br>
<br>
_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org" target="_blank">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/seanharr11%40gmail.com" rel="noreferrer" target="_blank">https://mail.python.org/mailman/options/python-dev/seanharr11%40gmail.com</a><br>
</blockquote></div>