Distributed Concurrency Control

前端 未结 13 1560
栀梦
栀梦 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条回答
  •  猫巷女王i
    2021-01-29 21:28

    you might want to consider using Hazelcast distributed locks. Super lite and easy.

    java.util.concurrent.locks.Lock lock = Hazelcast.getLock ("mymonitor");
    lock.lock ();
    try {
    // do your stuff
    }finally {
       lock.unlock();
    }
    

    Hazelcast - Distributed Queue, Map, Set, List, Lock

提交回复
热议问题