Re: "RuntimeError: dictionary changed size during iteration" ; Good atomic copy operations?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

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

From: Alex Martelli <aleaxit@yahoo.com>
Date: Mon Mar 13 2006 - 05:12:54 CET

Jean-Paul Calderone <exarkun@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
Received on Sun Apr 30 11:40:38 2006