On Thu, Jul 15, 2004 at 02:54:54PM -0400, Ian Beatty wrote:
Greetings.
I'm developing a Zope (2.7) product, and I've got a particular persistent object that's going to be a real bottleneck, in that there will be many threads trying to change the state of the object more or less simultaneously. I'd like to "spread out" the problem by taking member fields of the object (lists, dictionaries, etc.) and making them persistent sub-objects in their own right. That way, changes made to one of them can be saved to the ZODB without causing thread conflicts with changes being made to others, removing at least some of the thred conflicts.
sounds reasonable...
However, I don't know how to do this. Is it as simple as using a PersistentMapping where I'd normally use a standard Python dictionary?
Instead of PersistentMapping, see the various flavors of BTree, e.g. OOBTree, IOBTree. These do their own conflict resolution and in your scenario that could be a big help. -- Paul Winkler http://www.slinkp.com