From: Brian Candler Date: 2003-05-30T18:54:44+09:00 Subject: Re: Object Prevaylence vs. OODBMS or Madeleine vs. DyBase On Fri, May 30, 2003 at 06:13:56PM +0900, Anders Bengtsson wrote: > Since all "writes" to Madeleine have to go through the > execute_command() method, which is synchronized, this won't be a > problem. As you say, reads don't benefit from this protection. It might not be as bad as I thought: I was thinking that if you follow a reference from object A to object B, and the reference was changed in the mean time, you could end up pointing to a garbage object B. But actually you would be holding a reference to the object yourself, so it wouldn't be garbage-collected. But you could still end up with inconsistent reads, i.e. the objects are in a state which is neither how they were before execute_command nor after it, if execute_command is midway through its processing. > Maybe I should add a way to access Madeleine's big write lock from the > outside, if anyone wants to solve things the "global mutex" way. Sure. Perhaps you could add a wrapper for the traditional model of a shared read lock, and an exclusive write lock. (I'm not quite sure how to implement this; I guess the read lock manager would have to grab the write lock whenever 1 or more people asked for a read lock, and return it when this number went to 0, but you want a way to prevent starvation when someone is waiting for a write lock, e.g. no new readers are allowed until the write has had a chance) Cheers, Brian.