A semaphore tracks a pool of permits. A job acquires one to enter and returns it afterward so a waiting job can proceed.
Unlike a mutex, it can allow more than one concurrent holder. Failure to release permits reduces capacity or stalls the system.
When to use
Use it to cap concurrent API calls or connections.