[Zope-dev] ZODB thread safety issue.

Toby Dickenson tdickenson@geminidataloggers.com
Mon, 11 Mar 2002 11:57:16 +0000


On Sun, 10 Mar 2002 11:52:24 +0100 (CET), Romain Slootmaekers
<romain@zzict.com> wrote:

>This explains the problems we have with our system:
>we have a multithreaded system where each thread iteratese over a set of
>objects in the ZODB, and sees of something needs to be done... if so the
>thread does it. Now since each thread gets its own version of the =
object.
>our actions occur multiple times...=20

I suggest one thread that scans the database. when it finds some work
to be done it adds a specification of the work into a work queue.
Seperate worker threads get thier work specification from the queue.

Exactly how you store the work queue depends on other factors, but I
suggest not in ZODB.

Toby Dickenson
tdickenson@geminidataloggers.com