[Python-3000] patch: bytes object PyBUF_LOCKDATA read-only and immutable support
Greg Ewing
greg.ewing at canterbury.ac.nz
Fri Sep 14 01:26:28 CEST 2007
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
--
Greg
More information about the Python-3000
mailing list