WaitableEvent vs. Semaphore (Queues)

It turns out that this wasn’t quite right. If you’re willing to consume memory proportional to the number of waiting threads, create one WaitableEvent objects for each thread (they should be “cheap” in the target environment) and you don’t need a timeout capability (i.e. infinite wait), then the code I posted here works:

Semaphore Source Code