For some parallel code, I want to connect a bunch of signals together, like a circuit. In .NET, we can do WaitAll or WaitAny in a signal set. I want to do something like this:
WaitAny ( WaitAll (c1, c2), WaitAll (c3, c4) ) ;
Unfortunately, the library does not support the compilation of these operations in more complex trees. My questions are: (1) Is there a way to do this in .NET? (2) Is there a library for this in any language?
[edit: Corey asked for more]
I want to create a messaging library. There may be 10K small parallel queues, some with messages. I want to receive a message from the queue and execute the handler assigned to the queue. However, I cannot capture the following message until the handler is executed (single-threaded for each queue). So I really want to wait in line (received the message?) And the code (finished with the previous message?) Before I jump out and execute the next element.
source
share