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: EleSSaR^ <usenetpublic-elessar.xyz@yahoo.it>
Date: Sat Mar 11 2006 - 21:20:48 CET

robert si è profuso/a a scrivere su comp.lang.python tutte queste
elucubrazioni:

> own deepcopy: thus, do you already know if the existing deepcopy has the
> same problem as cPickle.dump ? (as the problem araises rarely, it is
> difficult for me to test it out)

I don't know the exact specs of your object, and I don't know what
operations are you performing on that object, nor the way they're atomic.

It seems like you're trying to save periodically the state of such object
while it is being modified (a sort of backup?), and Python complains about
that. A self-implemented deepcopy might raise anomalies (i.e. your dumped
object may be partly a 'before' object and partly an 'after' object ) as
well.

By the way, you could try employing locks from other threads to dump the
object as well... this would prevent additional locking.
 
> PS: how does ZODB work with this kind of problem? I thought is uses cPickle?

I have no idea about this.

-- 
EleSSaR^ <usenetpublic-elessar.xyz@yahoo.it>
--
Togli .xyz dalla mia email per contattarmi.
Received on Sun Apr 30 11:35:38 2006