[Python-ideas] Fwd: Concurrent safety?

Mike Meyer mwm at mired.org
Fri Nov 4 19:20:49 CET 2011


On Fri, Nov 4, 2011 at 10:49 AM, Jim Jewett <jimjjewett at gmail.com> wrote:
> On Fri, Nov 4, 2011 at 1:11 PM, Mike Meyer <mwm at mired.org> wrote:
>> On Thu, Nov 3, 2011 at 6:51 PM, Bruce Leban <bruce at leapyear.org> wrote:
>>>
>>> On Thu, Nov 3, 2011 at 9:38 AM, Mike Meyer <mwm at mired.org> wrote:
>>> We're wasting our time. You said above "You don't lock names, you lock
>>> objects." Why not? Because that was your original plan and your mind is
>>> closed to other ideas?
>
>> No, because I couldn't think of a way to make locking names work.
>
> Replace dicts (or at least globals and attribute dicts) with something
> that enforces your policy -- whether that is by a mutex, a mutex per
> entry, returning only copies of the values, etc...

Sorry, I wasn't sufficiently detailed. I never worried about how to
implement locking names, because I never could find a way to let
people use it. I'd like fine-grained locking (i.e. - specific
attributes of objects, the value at an index in  a key or dictionary,
etc.), you still need to be able to lock objects. They ways I came up
with for specifying "here's a name we can't rebind" were all very
complicated - among other things, what's a "name" is itself
complicated - and not worth the gain you got over object-level
locking. Especially if you have an STM option available.

As always, if you can think of a way to get all this working together,
please share!

    Thanks,
    <mike



More information about the Python-ideas mailing list