Stefan Behnel wrote:
Travis Oliphant wrote:
Stefan Behnel wrote:
Anyway, my point is that this part of the protocol actually implies
setting a
lock on the buffer *provider* rather than the buffer itself, as the
buffer
provider cannot distinguish between different buffers based on a NULL
pointer
Yes, the language in the PEP could be more clear.   Obviously, if you
haven't provided a Py_buffer structure to fill in, then you are only
asking to lock the object's buffer from other access.

That's what I'm questioning below.


I see what you are referring to. The protocol to lock the buffer after requesting and obtaining one was not well thought out. I think the use case I had in mind was locking in the buffer before actually getting it.

Once you have a buffer, I see how you may want to lock the buffer after getting it. For example, I could see how you may want to go from a non-locked read/write where you are guaranteed by the object that it won't move the memory but not that someone hasn't written to the memory area to an exclusive write-lock where no-one else can write to the area until you are done.

This should be clarified in the PEP.  Can you take a stab at it?

-Travis


_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to