Re: [Zope-dev] How is memory shared between Zope threads?
On Fri, 2 Mar 2001 15:33:37 -0500 (EST), "R. David Murray " <[EMAIL PROTECTED]> wrote: >On Fri, 2 Mar 2001, Erik Stephens wrote: >> Thanks for the response. If I understand you correctly, then as long a >> thread does not try to modify an out-of-date object, it will not try to >> re-read the most current version? Is that the expected behaviour? > >Hmm. Good question. I seem to remember reading about cases where >read-only transactions raised conflict errors in certain cases, but >I'm not sure. Hopefully someone from DC can chime in with a definitive >answer. The object cache only contains up-to-date objects when a transaction starts. ZODB will also raise a ConflictError when loading an object into the cache for reading, if it has been modified since the start of the transaction. Toby Dickenson [EMAIL PROTECTED] ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] How is memory shared between Zope threads?
On Fri, 2 Mar 2001, Erik Stephens wrote: > Thanks for the response. If I understand you correctly, then as long a > thread does not try to modify an out-of-date object, it will not try to > re-read the most current version? Is that the expected behaviour? Hmm. Good question. I seem to remember reading about cases where read-only transactions raised conflict errors in certain cases, but I'm not sure. Hopefully someone from DC can chime in with a definitive answer. --RDM ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] How is memory shared between Zope threads?
"R. David Murray" wrote: > > On Thu, 1 Mar 2001, Erik Stephens wrote: > > Naively, I can think of 2 approaches: a shared memory approach or a > > separate memory per thread with notifications. Zope behaves like each > > thread as its own copy of in-memory pieces and sometimes these > > per/thread memory blocks do not get updated. > > That is correct, each thread gets its own copy of the objects. My > understanding (from listening to this list, not from reading the code) > is that the ZODB checks when it goes to write out an object at the > end of a (sub)transaction to see whether another thread modified it, > and if so it raises a ConflictError and the entire transaction is > retried with the updated copy of the object. Thanks for the response. If I understand you correctly, then as long a thread does not try to modify an out-of-date object, it will not try to re-read the most current version? Is that the expected behaviour? Thanks, Erik ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] How is memory shared between Zope threads?
On Thu, 1 Mar 2001, Erik Stephens wrote: > Naively, I can think of 2 approaches: a shared memory approach or a > separate memory per thread with notifications. Zope behaves like each > thread as its own copy of in-memory pieces and sometimes these > per/thread memory blocks do not get updated. That is correct, each thread gets its own copy of the objects. My understanding (from listening to this list, not from reading the code) is that the ZODB checks when it goes to write out an object at the end of a (sub)transaction to see whether another thread modified it, and if so it raises a ConflictError and the entire transaction is retried with the updated copy of the object. --RDM ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] How is memory shared between Zope threads?
Hello all, I have noticed incosistencies between Zope threads when objects change. It appears that some threads see the new image of the object while others see the old image. Can anyone enlighten me on how Zope ensures that all threads are seeing the same images? Or at least point me to the modules in the source that handle these matters? Naively, I can think of 2 approaches: a shared memory approach or a separate memory per thread with notifications. Zope behaves like each thread as its own copy of in-memory pieces and sometimes these per/thread memory blocks do not get updated. System info: Zope 2.1.6, Redhat 6.2, PC arch Thanks, Erik ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )