Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/f2prateek/semaphore


https://github.com/f2prateek/semaphore

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

# semaphore

Provides a semaphore synchronization primitive. A semaphore controls access to a finite number of resources.

# Usage

```go
s := semaphore.New(5)

for {
s.Acquire()
// Only 5 go-routines will run simultaneously.
go func() {
defer s.Release()
}()
}
```