synchronized access to membase
Mon, 01/16/2012 - 10:13
I'm changing some code from using a synchronized map in Java to a using Membase. Is there a way to have the functionality of synchronization across threads with Membase? As of now, I'm using two multiple threads to create tuples by generating random number keys, and if done right, two threads will try to add the same key. I'm not sure on the protocol, but I believe if the index already exists, the functionality of the add will be the same as a touch? If there were anyway to avoid this though, that would be preferable.
Thanks in advance
Take a look at the memcached cas operation. It will allow you to update an operation only if no one else has changed it before you do.