Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoDoc

kmutex

Synchronization primitive that allows locking individual resources by unique ID.

This is not a distributed lock.

See golang.org/x/sync/singleflight if you want to reduce the number of calls to the same resource. Use kmutex if you want only one caller to use a resource at time.

Kubernetes kmutex hashes keys to a fixed set of locks, and is useful if you do not always need a separate lock for each resource. Take a look at the implementation, it is very straight forward.

GO PLAYGROUND EXAMPLE

About

Sync primitive for golang. Key + Mutex = Kmutex sync

Resources

Stars

18 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages