[Python-Dev] pre-PEP: The Safe Buffer Interface

Neil Hodgson nhodgson@bigpond.net.au
Wed, 31 Jul 2002 06:55:39 +1000


Thomas Heller (Guido, Thomas, Guido):
> [Guido]
> > > > I guess I still don't understand Neil's requirements.  What can't be
> > > > done with the existing buffer interface (which requires you to hold
> > > > the GIL while using the pointer)?
> > >
> > > Processing in Python :-(.
> >
> > Can you work out an example?
> Not sure, maybe Neil could do it better.

   I see this interface as a bridge between objects offering generic buffer
oriented facilities (asynch or low level I/O for example) and objects that
want to make it possible to use these facilities on their data (text
buffers, multimedia buffers, numeric arrays) by yielding a pointer to their
otherwise internal data.

   The bridging code between the two objects is unrestricted Python code
that may cause memory to be moved around.

   Neil