[Python-ideas] Fwd: Concurrent safety?
Terry Reedy
tjreedy at udel.edu
Tue Nov 1 07:55:23 CET 2011
On 11/1/2011 1:32 AM, Mike Meyer wrote:
> As you point out, this is a hard problem. I know I haven't covered all
> the issues. That's why the second thing I said was that I'm hoping to
> get people smarter than me to look at things.
This is one of the hard problems that keep getting swept under the rug
while we do easier things. Well, we have overhauled unicode and
packaging for 3.3, so maybe concurrency can get some attention.
I keep thinking that CPython's design of allowing C coded modules either
outside or inside the stdlib should allow some progress.
Would it be helpful, for instance, to have truly immutable restricted
tuples and frozensets, whose __new__ methods only allowed true
immutables (None, booleans, numbers, strings, other restricted tuples
and frozensets) as members?
How about a metaclass, say 'immutable', that made the instances of a
user class truly immutable? (I don't know how to do this, but lets
assume it can be done -- perhaps with a new frozendict.) If such were
possible, instances of instances of such a metaclass could be added to
the list above.
Could a metaclass automatically add fine-grained locks around around
attribute mutations?
--
Terry Jan Reedy
More information about the Python-ideas
mailing list