atomic operations in presence of multithreading
Duncan Booth
me at privacy.net
Wed Jul 28 04:21:46 EDT 2004
Paul Moore <pf_moore at yahoo.co.uk> wrote in news:y8l55cwa.fsf at yahoo.co.uk:
> Given that the original question was about dictionaries, which are
> coded in C (and so not subject to this issue) there is still the
> following case: when the old value stored in the dictionary is
> replaced, that could be the last reference to it. When the old value
> is freed, its __del__ method gets called - arbitrary Python code
> again.
Right, but the new value has already been stored in the dictionary at the
point where the __del__ method is called, so as far as the OP is concerned
this is still safe.
More information about the Python-list
mailing list