问题
I just want to know what is distributed Atomic lock means in caches drivers?
回答1:
Distributed locks are well documented, in multiple sources.
The atomic attribute refers to the indivisible test-and-set that should be part of the lock request. Otherwise, two contenders may test at the same time, and then both set and walk away thinking they got exclusivity on the resource.
Since it is a must, you often find the term simply as distributed lock.
Now, some sources:
- Antirez (Redis creator) criticized must client implementations while making a good analysis of the challenges of a distributed lock. He called his solution Redlock. Distributed locks with Redis
- Then Martin Kleppmann, author of Designing Data-Intensive Applications, criticized Redlock and proposed his solution in How to do distributed locking
- Then Antirez replied, in Is Redlock safe?
Going through these three articles will give you a strong sense of how to implement a distributed lock.
来源:https://stackoverflow.com/questions/55075942/what-is-distributed-atomic-lock-in-caches-drivers