Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LockMap ¶
type LockMap struct {
// contains filtered or unexported fields
}
LockMap is a map of mutexes that automatically allocates and deallocates mutexes as necessary. It allows for fine-grained mutual exclusion for a potentially large key space, while only consuming space propotional to the number of acquired mutexes. The zero-initialised LockMap is ready to use.
type SemaphoreMap ¶
type SemaphoreMap struct {
// contains filtered or unexported fields
}
SemaphoreMap is a map of semaphores that automatically allocates and deallocates semaphores as necessary. It allows for fine-grained semephore use, such as resource allocations and concurrent resource limits, for a potentially large key space, while only consuming space propotional to the number of acquired semaphores.
func NewSemaphoreMap ¶
func NewSemaphoreMap(n int64) *SemaphoreMap
func (*SemaphoreMap) AcquireContext ¶
func (*SemaphoreMap) TryAcquire ¶
func (m *SemaphoreMap) TryAcquire(key string, n int64) *Semaphore
Click to show internal directories.
Click to hide internal directories.