[Python-3000] patch: bytes object PyBUF_LOCKDATA read-only and immutable support
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 SHARED_READ, SHARED_WRITE, EXCLUSIVE_READ, EXCLUSIVE_WRITE
>
> EXCLUDE_WRITE might be better, since EXCLUSIVE_WRITE seems
> to imply that one is writing oneself as well.
>
> > EXCLUSIVE_READ - 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
> READ_LOCK which includes EXCLUDE_WRITE, so it will fail
> if you're already holding a write lock.
>
> So we just have
>
> READ
> WRITE
> READ_LOCK = READ | EXCLUDE_WRITE
> WRITE_LOCK = WRITE | EXCLUDE_WRITE
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