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

2008-06-04 Thread Stefan Behnel
Hi Greg, Greg Ewing canterbury.ac.nz> writes: > The way I thought this was supposed to work is that the > buffer is *always* locked while the client is accessing > it, the only choice being whether it's a read-only or > read-write lock. I don't think there should always be a lock in the sense th

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

2008-06-04 Thread Stefan Behnel
Greg Ewing canterbury.ac.nz> writes: > The way I thought this was supposed to work is that the > buffer is *always* locked while the client is accessing > it, the only choice being whether it's a read-only or > read-write lock. Thinking about this some more while updating the PEP: This scheme ha

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

2008-06-04 Thread Greg Ewing
Stefan Behnel wrote: I don't think there should always be a lock in the sense that the requestor is the only permitted accessor. No, but there's always a lock in the sense that the provider is not allowed to move the memory while the buffer is in use. As for the other forms of locking, I'm sti

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

2008-06-04 Thread Greg Ewing
Stefan Behnel wrote: So you'd always have to release your own read buffer before acquiring a write buffer Yes, you really want to be able to upgrade your own lock from a read lock to a write lock, which means the provider has to keep track of who the lock holder is somehow. The more I think ab