3 ms·
Presumably the semaphore would be used to limit the number of concurrent virtual threads. Incoming tasks can be rejected proactively if a system would overflow
by mdavidn 1y ago
Presumably the semaphore would be used to limit the number of concurrent virtual threads.
Incoming tasks can be rejected proactively if a system would overflow its limit on concurrent tasks. This approach uses a semaphore’s non-waiting acquire and release operations. See the “bulkhead pattern.”
Alternatively, if a system has a fixed number of threads ingesting tasks, these would respond to backpressure by waiting for available permits before creating more virtual threads.