[Python-3000] patch: bytes object PyBUF_LOCKDATA read-only and immutable support (original) (raw)
Greg Ewing greg.ewing at canterbury.ac.nz
Fri Sep 14 01:26:28 CEST 2007
- Previous message: [Python-3000] patch: bytes object PyBUF_LOCKDATA read-only and immutable support
- Next message: [Python-3000] patch: bytes object PyBUF_LOCKDATA read-only and immutable support
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
EXCLUDE_WRITE might be better, since EXCLUSIVE_WRITE 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 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
- Previous message: [Python-3000] patch: bytes object PyBUF_LOCKDATA read-only and immutable support
- Next message: [Python-3000] patch: bytes object PyBUF_LOCKDATA read-only and immutable support
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]