Guaranteed semaphore order?

documentation for the .NET class Semaphore states that:

There is no guaranteed order, such as FIFO or LIFO, in which blocked threads enter the semaphore.

In this case, if I need a guaranteed order (FIFO or LIFO), what are my options? Is it really impossible? Should I write my Semaphore? I guess this will be pretty advanced?

Thanks,

Steve

+7
multithreading c # asynchronous semaphore
source share
1 answer

See this :

FifoSemaphore works exactly like the regular Semaphore , but also ensures that tokens are served to customers in the order in which they manage to obtain an internal lock. The use of FifoSemaphore identical to Semaphore .

+5
source share

All Articles