From cdd33423dfd856b59097e77538ceebdf59ed7952 Mon Sep 17 00:00:00 2001 From: hello Date: Tue, 19 Nov 2024 08:23:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E5=B8=83=E5=BC=8F=E9=94=81=E5=8E=9F?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- notes/helloshop/distributed-lock.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/notes/helloshop/distributed-lock.md b/notes/helloshop/distributed-lock.md index 3c9f069..cc8e3d2 100644 --- a/notes/helloshop/distributed-lock.md +++ b/notes/helloshop/distributed-lock.md @@ -46,4 +46,9 @@ https://github.com/madelson/DistributedLock 零度框架中提供分布式锁的基本抽象,并基于 Dapr 实现了分布式锁。 -https://docs.dapr.io/developing-applications/building-blocks/distributed-lock/distributed-lock-api-overview \ No newline at end of file +https://docs.dapr.io/developing-applications/building-blocks/distributed-lock/distributed-lock-api-overview + + +## Redis 分布式锁原理 + +Redis 分布式锁的实现原理是通过 SETNX 命令,SETNX 是 Redis 的一个原子性操作,它会在键不存在时设置键的值,如果键已经存在,则不做任何操作。 \ No newline at end of file