[Python-3000] patch: bytes object PyBUF_LOCKDATA read-only and immutable support (original) (raw)

Gregory P. Smith greg at krypto.org
Sat Sep 15 19:56:46 CEST 2007


On 9/13/07, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:

Gregory P. Smith wrote: > When I read the plain term EXCLUSIVE I read that to mean nobody else can > read -or- write, ie: not shared in any sense.

You're right, it's not the best term. > Lets extend these base > concepts to SHAREDREAD, SHAREDWRITE, EXCLUSIVEREAD, EXCLUSIVEWRITE EXCLUDEWRITE might be better, since EXCLUSIVEWRITE seems to imply that one is writing oneself as well. > EXCLUSIVEREAD - no others can read this buffer while this view is > open. This is the one that I don't think is necessary. I don't see a need to ever prevent others from reading if they really want to and are prepared to deal with the consequences. Most of the time the other party will be using READLOCK which includes EXCLUDEWRITE, so it will fail if you're already holding a write lock. So we just have READ WRITE READLOCK = READ | EXCLUDEWRITE WRITELOCK = WRITE | EXCLUDEWRITE

I like your terminology. Also, agreed that EXCLUDE_READ is not likely to be necessary; I listed it for completeness sake.



More information about the Python-3000 mailing list