Are semaphores released FIFO, random, or using some other algorithm? Does the algorithm avoid starvation?
+1
A:
This article says you cannot assume FIFO, though seems to slightly imply that FIFO is what is generally expected. I might be overstating that, though.
This article confirms that they are not guaranteed to be released in any order:
Semaphores in C# are not First in First Out, the implementation actually does not guarantee the order in which tasks are released.
Michael Haren
2009-05-07 15:56:35
Do you know if the algorithm is designed to avoid starvation?
Orion Adrian
2009-05-07 16:13:05
I would guess that starvation is unlikely but not guaranteed. Just a guess, though.
Michael Haren
2009-05-07 16:59:04