[ZODB-Dev] How to update an object in a multithreading application?

2012-03-19 Thread Sebastian Wain
I am updating an item in a separated thread but when it finishes the new value is not updated in the same object in the main thread. In the example below root['counter'] starts in 0, is incremented in the new thread but it remains in 0 in the main thread. #!/usr/bin/python from ZODB.Fil

Re: [ZODB-Dev] How to update an object in a multithreading application?

2012-03-19 Thread Sebastian Wain
>Le lundi 19 mars 2012 18:57:53, Alan Runyan a écrit : >> if your increment a counter its best the counter be of type, >> BTrees.Length >Depends on the usage. If generated numbers are intended to become unique identifiers, a BTree.Length is definitely not >what he wants. >Conflicts are good

Re: [ZODB-Dev] How to update an object in a multithreading application?

2012-03-20 Thread Sebastian Wain
>> Indeed I want to sync the same BTree between threads. I am adding >> persistence and acknowledgement to the Python queue. >I don't understand what you mean by: >- "sync": ZODB is probably not a good backend to provide synchronisation as a > feature, ie it's not a "lock server" and does what it