From 6f0df28317734146fc758b52698bb9221a7debc9 Mon Sep 17 00:00:00 2001 From: "Peter J. Keleher" <keleher@cs.umd.edu> Date: Tue, 19 Sep 2023 22:27:15 -0400 Subject: [PATCH] auto --- p2.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/p2.md b/p2.md index cf29c3b..184c549 100644 --- a/p2.md +++ b/p2.md @@ -67,12 +67,10 @@ gRPCs. The first part is taking your simple blob store and splitting it to a distinct blob *store* in `p2/ubi/server.go` and command-line tools `p2/blob.go` and `p2/lock.go`. -The second part is building a lock server that will take an *acquire* request for a file -path and acquire read (SHARED) locks on the entire path from the root down to the path's -tail, except that the very last might be a write (EXCLUSIVE) lock, depending on the mode -requested by the gRPC. For example, an incoming acquire (EXCLUSIVE) request for `/foo/bar.go` would -result in a shared lock of `/`, a shared lock on `/foo`, and then an exclusive lock on -`/foo/bar.go`. +The second part is building a lock server that will allow shared and + exclusive locking of any random string. You do not have to do locking + of prefixes of the path. + Each of these locks should be implemented with `sync.RWMutex`, and acquire requests for paths already locked with incompatible modes would result in the gRPC request being blocked -- GitLab