[Python-ideas] async objects

Ethan Furman ethan at stoneleaf.us
Wed Oct 5 15:51:47 EDT 2016


On 10/05/2016 12:20 PM, Sven R. Kunze wrote:
> On 05.10.2016 18:06, Nick Coghlan wrote:

>> Guido's idea of a shadow thread to let synchronous threads run
>> coroutines without needing to actually run a foreground event
>> loop should provide a manageable way of getting the two runtime
>> models (traditional C and asynchronous coroutines) to play
>> nicely together in a single application, and has the virtue of
>> being something folks can readily experiment with for themselves
>> before we commit to anything specific in the standard library
>> (since all the building blocks of thread local storage, event
>> loop management, and inter-thread message passing primitives are
>>  already available).
>
> I needed to think about this further when Guido mentioned it. But
>  I like it now.
>
> If you check https://github.com/srkunze/fork/tree/asyncio , I
> already started working on integrating asyncio into xfork at long
> time ago. But I still couldn't wrap my mind around it and it
> stalled. But IIRC, I would have implemented a shadow thread
>  solution as well. So, if his idea goes into the stdlib first, I
>  welcome it even more as it would do the heavy lifting for me. xfork
> would then be just a common interface to threads, processes and
>  coroutines.

At this point I'm willing to bet that you (Sven) are closest to actually having a shadow thread thingy that actually works.  Maybe some other asyncio folks would be willing to help you develop it?

--
~Ethan~


More information about the Python-ideas mailing list