Sync ⋅ Semaphore
Instead of providing exclusive access to a single party, they provide access to a limited set of N parties at the same time. This makes them great to control concurrency, e.g. limiting an HTTP client to X concurrent requests, so the HTTP server doesn’t get overwhelmed.
Lock instances can be acquired using
Please refer to the
Mutex documentation for additional usage documentation, as they’re basically equivalent except for the fact that
Mutex is always a
Semaphore with a count of exactly one party.
In many cases you can use concurrent iterators instead of directly using a