I have two ideas to support single producer and multiple consumers.
The objective is that whichever consumer gets the data, processes it ( removes the element) and other consumers pick from next available element.
There are the options that I have now:
1. Create a consumer interface. Have all the consumers register themselves to the queue. Use observer
pattern to propagate message availability signaled by producer.
2. Create a consumer interface, all consumers register themselves to the queue. Use a
thread pool with task to dequeue elements. All threads in the pool will take turn to dequeue elements, each thread representing a consumer.
There is one contention in the dequeue method, I am using lock which will be used by only one thread at a time. If I have to speed up the process, I will have to think of bringing real concurrency to this process.
I am engaged is some other task right now. But I will get on with trying both these approaches once I am free.