Prev: llvm vs. parrot
Next: store encrypted data in sqlite ?
From: rooster 808 on 28 Sep 2009 12:17 I'm trying to work out a multiple readers, one writer scenerio with a bunch of objects. Basically "foo" objects are shared across processes. Each foo object has a .lock variable, which holds a Mutex. In creation, I'd like to call the SyncManager, get the dict() object which hold object_ids->lock mappings (so we can create a lock per object only once)... Creating the lock map happens like this: if not object_locks.has_key(object_id): new_lock = manager.Lock() manager.object_locks.update({ object_id: new_lock}) Everything seems fine, except, on retrieval of the SyncManager.get_object_locks().get(object_id) I get a Unserializable message: ('#RETURN', <thread.lock object at 0x177b190>) I had thought the multiprocessing Lock was serializable and shared. Any other alternatives versus a global lock around all object writes?
|
Pages: 1 Prev: llvm vs. parrot Next: store encrypted data in sqlite ? |