"RuntimeError: dictionary changed size during iteration" ; Good atomic copy operations?

Alex Martelli aleaxit at yahoo.com
Sun Mar 12 23:12:54 EST 2006


Jean-Paul Calderone <exarkun at divmod.com> wrote:
   ...
> This is vaguely possible using sys.setcheckinterval() now, although one
> has to pick a ridiculously large number and hope that the atomic operation
> takes fewer than that many opcodes.
> 
> Spelling "do not switch threads" as sys.setcheckinterval(None) seems
> somewhat natural, though.  Perhaps that would be a fruitful direction to
> explore.

Indeed, it's a simple enough idea that it's worth proposing to
python-dev for consideration for 2.5, since the patch connected to
implementing it should be tiny. The only issue is whether Python
(meaning Guido) WANTS to change in order support this rough-and-ready
approach to multithreading; I hope he doesn't, but if he does we might
as well get it over with now.


Alex



More information about the Python-list mailing list