![]() |
Available news archives:
comp.lang.tcl
-
comp.lang.python
-
comp.security.firewalls
-
sci.crypt -
comp.lang.php -
comp.lang.javascript
|
|
comp.lang.python archiveRe: "RuntimeError: dictionary changed size during iteration" ; Good atomic copy operations?
From: robert <no-spam@no-spam-no-spam.com>
Date: Sun Mar 12 2006 - 00:37:36 CET
EleSSaR^ wrote:
There is not much to know. Python object trees consist only of dicts and
Thus the RuntimeError problem is only about modified dicts/lists during
> It seems like you're trying to save periodically the state of such object
Yes, a "backup" / autosave while all threads are running. It doesn't
> By the way, you could try employing locks from other threads to dump the
Don't understand.
Regarding what AM said, I would have to lock _each_ dict/list operation
AFAIK about the current Python implementation: This RuntimeError is only
def rt_save_dict_copy()
without true iteration over the original dict whould copy without
(or maybe equivalent: "dict(fromd.items())" ? )
I don't know if dict.copy() works so - but I think so, as dict.keys()
The algorithm in cPickle.dump does not work so. Guess it does something
Will have to see what copy/deepcopy does ...
Robert
|