[Async-sig] async executors

Yury Selivanov yselivanov at gmail.com
Mon Jun 6 12:52:51 EDT 2016


Hi Christoph,

[..]
> • Performance is better, especially when many worker processes are  involved, because of the simpler code that uses less locking  (the only locking that remains is inside the multiprocessing  module).

Yes, it will be better, but the performance improvements will be visible only for 100s or 1000s of processes.  And only if they are executing short-living tasks.

Is there a real need for a bit faster process pool?

[..]
> Are there other possible advantages or disadvantages?

1. Backwards compatibility?  We’ll have to continue to support concurrent.futures executors.

2. More code in asyncio core -> more work for alternative event loop implementations such as uvloop.

3. Stability.  concurrent.futures is mature and well tested.

> Based on concurrent.futures.ProcessPoolExecutor, I’ve made a proof-of-concept implementation [3] that demonstrates that the idea works.  (There have been some improvements compared to the version that I posted on python-ideas.)

I think you should stabilize the code base, and release it as a module on PyPI.

[..]
> I would be grateful if any asyncio experts could have a look at the part of the main loop of the process management coroutine where the coroutine awaits new data [4].  Currently, I am using an asyncio.Event that is set by a callback via asyncio’s add_reader().  Is this the most natural way to do it currently? 

I think you can use asyncio.Future for resuming that coroutine.

Thanks,
Yury



More information about the Async-sig mailing list