title: Can I 'pretend' I have a one-to-one producer-consumer problem instead of many-to-one?
body: <p>I suspect this is a relatively obscure and specific question, so I'll try to be as clear as possible in describing it. All of my code is being done in C++ in pursuit of a computer vision project.</p>
  <ol>
  <li>I have a primary thread, acting as a consumer.</li>
  <li>This thread generates N producers that need to use a hodgepodge of proprietary software to acquire images from their camera buffers. Each of them does a quick conversion to cv::Mats before passing them along to the consumer for actual processing.</li>
  </ol>
  <p>Here's where I trip up. <strong>Is it possible to twist this multiple-producer-single-consumer problem into a set of N single-producer-single-consumer problems? Something like this?</strong></p>
  <pre><code>while(
  0 == pipeBuffer1.read_available() ||
  0 == pipeBuffer2.read_available() ||
  ...
  0 == pipeBuffern.read_available()
  ) { //wait
  }
  
  // do a fifo pop for each buffer and fuse them all into a single frame
  </code></pre>
  <p>I ask because, by my best understanding, I can transition over to lock-free ring buffers in the single-single version of the problem. I can't immediately see a reason why I <em>can't</em> treat my design issue this way, but my experience is slim to nil with multithreading and I figured I might as well ask before wasting my time trying to implement something that can't work.</p>