H
Hollywood
I have a system in which I have a single thread that places data on a Queue.
Then I have one worker thread that waits until data is put on the thread and
dequeues the Queue and processes that information. Works just fine.
However, I possibly need 1..m worker threads that can act on the same piece
of data, i.e. when a dequeue happens on the Queue it can't be removed from
the Queue until all threads have used it. I've tried to come up with good
ways of doing this but haven't found anything I liked or has worked. I
think I'd really like to just get rid of the Queue and send the packet of
data when I trigger the waiting threads, i.e. an expanded ManualResetEvent.
That way each thread can get the same piece of data and process it
independently. However, ARE and MRE are sealed and I've not seen any good
information on replicating them to be able to extend them to send a packet
along with the set trigger.
Thoughts or comments?
Then I have one worker thread that waits until data is put on the thread and
dequeues the Queue and processes that information. Works just fine.
However, I possibly need 1..m worker threads that can act on the same piece
of data, i.e. when a dequeue happens on the Queue it can't be removed from
the Queue until all threads have used it. I've tried to come up with good
ways of doing this but haven't found anything I liked or has worked. I
think I'd really like to just get rid of the Queue and send the packet of
data when I trigger the waiting threads, i.e. an expanded ManualResetEvent.
That way each thread can get the same piece of data and process it
independently. However, ARE and MRE are sealed and I've not seen any good
information on replicating them to be able to extend them to send a packet
along with the set trigger.
Thoughts or comments?