[Python-3000] Single buffer implied in new buffer protocol?

Greg Ewing greg.ewing at canterbury.ac.nz
Thu May 29 02:31:52 CEST 2008


Lisandro Dalcin wrote:
> You emit a
> Comm.Recv_init() call with the pointer to the buffer receiving the
> message (then you have to ask the object for the buffer pointer).
> ... Then when you initiate the communication, we should
> lock the object

No, you can't rely on a buffer pointer returned earlier
if the object may have been unlocked in the meantime.

The right thing to do in this case is just keep a
reference to the object whose buffer you're going to
be storing the result in. Then when it comes time to
start the receive, you obtain the buffer pointer and
lock the object at the same time.

-- 
Greg


More information about the Python-3000 mailing list