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-January/151783.html below:

[Python-Dev] PEP 567 v3

[Python-Dev] PEP 567 v3 [Python-Dev] PEP 567 v3Guido van Rossum guido at python.org
Tue Jan 16 19:45:42 EST 2018
On Tue, Jan 16, 2018 at 4:37 PM, Antoine Pitrou <solipsis at pitrou.net> wrote:

> On Tue, 16 Jan 2018 17:44:14 -0500
> Yury Selivanov <yselivanov.ml at gmail.com> wrote:
>
> > Offloading execution to other threads
> > -------------------------------------
> >
> > It is possible to run code in a separate OS thread using a copy
> > of the current thread context::
> >
> >     executor = ThreadPoolExecutor()
> >     current_context = contextvars.copy_context()
> >
> >     executor.submit(
> >         lambda: current_context.run(some_function))
>
> Does it also support offloading to a separate process (using
> ProcessPoolExecutor in the example above)?  This would require the
> Context to support pickling.
>

I don't think that's a requirement. The transparency between the two
different types of executor is mostly misleading anyway -- it's like the
old RPC transparency problem, which was never solved IIRC. There are just
too many things you need to be aware of before you can successfully offload
something to a different process.

-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20180116/27e91755/attachment.html>
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