[Python-ideas] An alternate approach to async IO

Trent Nelson trent at snakebite.org
Wed Nov 28 13:36:01 CET 2012


On Tue, Nov 27, 2012 at 11:02:58PM -0800, Antoine Pitrou wrote:
> On Tue, 27 Nov 2012 19:15:14 -0500
> Trent Nelson <trent at snakebite.org> wrote:
> 
> > On Tue, Nov 27, 2012 at 03:50:34PM -0800, Guido van Rossum wrote:
> > > On Tue, Nov 27, 2012 at 3:33 PM, Sturla Molden <sturla at molden.no> wrote:
> > > >
> > > > Den 27. nov. 2012 kl. 23:36 skrev Trent Nelson <trent at snakebite.org>:
> > > >
> > > >>
> > > >>    Right, but with things like interlocked lists, you can make that
> > > >>    CPython|background_IO synchronization barrier much more performant
> > > >>    than relying on GIL acquisition.
> > > >
> > > > You always need the GIL to call back to Python.  You don't need it for anything else.
> > > 
> > > You also need it for any use of an object, even INCREF, unless you
> > > know no other thread yet knows about it.
> > 
> >     Right, that's why I proposed using non-Python types as buffers
> >     whilst in the background IO threads.
> 
> Trent, once again, please read about Py_buffer.

    Sorry, I did see your previous e-mail, honest.  Please interpret
    that sentence as "that's why I proposed using something that doesn't
    need to hold the GIL in the background IO threads".  Where 'something'
    sounds like it should be Py_buffer ;-)

        Trent.



More information about the Python-ideas mailing list