Multiple Producer single consumer
<p>I am having trouble understanding the multiple producers and single consumer problem. I am working on an assignment and I am unsure on how creating two producers work.. I understand how the single producer/consumer problem works but I cannot understand how to go about multiple producers would I need to create two separate threads for each producer, if that is the case how does filling a queue up with their 'produced data' would one of the producers need to be asleep while the other producer fills say a single data item and then they switch back and forth until the queue buffer is full?</p>

<p>Just looking for an explanation as I do not understand exactly how this would work (before someone makes the suggestion I am looking for someone to do my homework thats not the case just looking for helpful insight to clear up my thoughts on this so I can implement it myself) </p>

<p>I have looked at many other questions/topics about this on this and various other websites and still haven't been able to come to a conclusion on my answer.</p>

<p>Thanks!</p>