diff --git a/p2.md b/p2.md index cf29c3b7994e1c6e930d3e03378552bbdbdb20df..184c549e2771340625e5be869d3ea1b97a53f125 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