I didnβt come across this myself, but I thought that I would investigate and summarize my conclusions, as it is better to answer direct answers than external links (although, yes, read the OP after the recommendation):
allows the number of concurrent permissions allowed for semaphore protected code. Although semaphores are often simple mutex, it is sometimes desirable to have more than one touch of code. This is like a call to a call center, where one phone number is connected to 8 lines / operators.
justice - this is when the semaphore becomes available to the requesting persons in the strict order of the one who asked first. Remaining with the call center analogy, this means that the waiting queue is in strict FIFO.
barging is essentially an out-of-band request that puts the stream at the top of the queue for the semaphore. The analogy is that preferred clients (or internal calls) go to the top of the call center queue rather than waiting in line.
If neither justice nor barging is indicated , then it is in the specification to provide access to the most recent request, depending on the context switching time. βA telephone analogy is a call to a companyβs switch / receiver, where even if calls are waiting to be answered, you may get lucky and make calls between one end of the call and the other is disarmed.
Let me know through the comments if I am wrong and I will correct / cw my answer.
source share