Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/janos/multex
Multiple mutual exclusion lock
https://github.com/janos/multex
go golang lock mutex
Last synced: about 1 month ago
JSON representation
Multiple mutual exclusion lock
- Host: GitHub
- URL: https://github.com/janos/multex
- Owner: janos
- License: bsd-3-clause
- Created: 2019-05-18T20:30:38.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-03-24T09:55:36.000Z (over 2 years ago)
- Last Synced: 2024-05-06T07:01:17.718Z (6 months ago)
- Topics: go, golang, lock, mutex
- Language: Go
- Size: 5.86 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Multiple mutual exclusion lock
[![GoDoc](https://godoc.org/resenje.org/multex?status.svg)](https://godoc.org/resenje.org/multex)
[![Go](https://github.com/janos/multex/workflows/Go/badge.svg)](https://github.com/janos/multex/actions?query=workflow%3AGo)Package mutex provides multiple mutual exclusion lock. The name is
constructed by combining a common name for mutual exclusion locks, Mutex, and
word multiple, which is a property of this specific implementation. Multex
locking and unlocking for a single key is a few times slower then locking
with sync.Mutex, but provides the ability to lock the same block of code with
specific keys, allowing concurrent execution of the same code only for
different keys.Performance comparison of Multex with a single key and sync.Mutex can be done
by running benchmarks in this package.```
BenchmarkMultex-10 39488458 26.89 ns/op 0 B/op 0 allocs/op
BenchmarkMutex-10 86903780 13.41 ns/op 0 B/op 0 allocs/op
```## Installation
Run `go get resenje.org/multex` from command line.