Creates a signal that queues callers until signaled. Releases only 1 queued caller each time it is signaled, then automatically resets into a blocked state.
The auto reset signal can be used to create a critical section
-- i.e. a block
of code that can only be executed by 1 caller at a time. Every other caller will
be queued in the order they arrive, and the next caller in the queue will only
be allowed to enter the critical section when the previous caller leaves the
critical section.
A signal that releases 1 caller each time it is signaled.
Creates a signal that will queue callers until the counter reaches 0. At that point, all callers will be invoked in the order they were queued.
The initial count of the signal. Must be a non-negative integer.
Queues callers until the counter reaches 0.
Limits access to a pool of resources by restricting how many callers can run at a time. Any callers above the allowed amount will be queued until a spot is released.
The maximum number of parallel callers to allow.
Limits access to a pool of resources by restricting how many callers can run at a time.
Provides utilities for synchronizing blocks of code.
There are 4 types of signals provided in this module:
Manual Reset Signal
Think of the manual reset signal as a traffic light. While it is red, all cars are queued in the order they arrive. Once the light is signaled green, the cars can proceed in the order they arrived. And as long as the light remains green, any future cars can proceed.
Use cases:
Auto Reset Signal
The auto reset signal can be used to create a
critical section
-- i.e. a block of code that can only be executed by 1 caller at a time. Every other caller will be queued in the order they arrive, and the next caller in the queue will only be allowed to enter the critical section when the previous caller leaves the critical section.Use cases:
Countdown Signal
A countdown signal allows you to queue callers until a certain number of operations have completed.
Use cases:
Semaphore
Think of a semaphore as a bouncer at a club who ensures that only a certain number of people are allowed in at one time. In other words, semaphores are used to control access to a limited pool of resources.
Use cases: