Fair-Mutex - an RWMutex implementation which gives equal priority to read and write locks
github.com·3h·
Discuss: r/golang
Flag this post

Fair-Mutex

fair-mutex is a Go implementation of a fair RW mutex; that is, a mutex where write locks will not be prevented in a high volume read-lock use case. The larger the number of write locks required, the larger the performance benefit over sync.RWMutex. This is perhaps a fairly narrow use-case; if you don’t need this then consider using go-lock if the built-in sync.RWMutex or sync.Mutex do not meet your needs. To see if fair-mutex might meet your needs, start by looking at the benchmark results.

This implementation can be used as functional a drop-in replacement for Go’s sync.RWMutex or sync.Mutex as at Go 1.25 (with limitations - please see below...

Similar Posts

Loading similar posts...