Skip to content

im7mortal/kmutex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages