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

Thomas Heller thomas.heller@ion-tof.com
Tue, 30 Jul 2002 21:22:53 +0200


[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.

However, you yourself pointed out to Greg that it may be unsafe
to even call Py_DECREF() on an unrelated object.

>  I don't understand what you can do in
> Python, apart from passing it to something else that takes the buffer
> API or converting the data to a string or a bytes buffer.

Or pack it into a buffer *object* and hand it to arbitrary
Python code. That's what we have now.

What does 'hold the GIL' mean in this context?
No other thread can execute: we have complete control
over what we do. But what are we *allowed* to do?

Thomas