SV: SV: SV: [ZODB-Dev] Flush

Magnus Heino magnus.heino@pleon.sigma.se
Mon, 4 Feb 2002 16:31:33 +0100


> > self.__isRunning and calls start_new_thread(self.method, ()) if it was
> > running when before. This way the thread will start if it was
> running when
> > the app was closed. But also if the object was flushed... :-P
>
>
> Whoa, that won't work.  Under the current ZODB model, every thread has
> its own copy of objects.  When you start a new thread, you have to load
> new copies.  Otherwise you'll get rampant race conditions.

But since I was running a single thread, I thought that objects were not
flushed from memory... but I was wrong. ;)

I solved it but registering my threads in Globals.running_threads{} and then
I use the ZODB objects to control the threads... that approach seems to be
working just fine.

Thanks

/Magnus