Distributed Concurrency Control

前端 未结 13 1559
栀梦
栀梦 2021-01-29 20:35

I\'ve been working on this for a few days now, and I\'ve found several solutions but none of them incredibly simple or lightweight. The problem is basically this: We have a cl

13条回答
  •  佛祖请我去吃肉
    2021-01-29 21:14

    You might also consider Cacheonix for distributed locks. Unlike anything else mentioned here Cacheonix support ReadWrite locks with lock escalation from read to write when needed:

    ReadWriteLock rwLock = Cacheonix.getInstance().getCluster().getReadWriteLock();
    Lock lock = rwLock.getWriteLock();
    try {
      ...
    } finally {
      lock.unlock();
    }
    

    Full disclosure: I am a Cacheonix developer.

提交回复
热议问题