Documentation ¶
Overview ¶
lockmap is a sharded lock map.
The API is as if LockMap consisted of a lock for every possible uint64 (which we think of as "addresses", but they could be any abstract location); LockMap.Acquire(a) acquires the lock associated with a and LockMap.Release(a) release it.
The implementation doesn't actually maintain all of these locks; it instead maintains a fixed collection of shards so that shard i is responsible for maintaining the lock state of all a such that a % NSHARDS = i. Acquiring a lock requires synchronizing with any threads accessing the same shard.
Index ¶
Constants ¶
View Source
const NSHARD uint64 = 65537
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.