[Python-3000] patch: bytes object PyBUF_LOCKDATA read-only and immutable support

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Sep 12 01:15:47 CEST 2007


Jim Jewett wrote:
> 
> why does it need the lock the whole time?
> Is someone getting known stale data (when you could tell them to
> wait) always OK, but overwriting someone else's change never is?

In a threaded environment, it shouldn't really be
a problem as long as the view of the data is consistent.
It's no different from what would have happened if the
reading thread had got there just a moment sooner,
before the writer got hold of it.

If that's a problem, there should have been some
higher-level synchronisation going on before getting
to that point.

--
Greg


More information about the Python-3000 mailing list