title: How can I get those two processes (programs) talk to each other directly using pipes?
body: <p>Program A, is a c program that endlessly, receives input in stdin, process it and output it to stdout.</p>
  
  <p>I want to write program B (in python) so it will reads A's output, and feed it back with whatever is needed. 
  Note there must be only one instance of each of those programs, so given b1 and b2 which are instances of b instead of:</p>
  
  <pre><code>$ b1 | a | b2
  </code></pre>
  
  <p>I need to have </p>
  
  <pre><code>$ b1 | a | b1 
  </code></pre>
  
  <p>The following is the diagram of the final desired result:</p>
  
  <p><img src="https://i.stack.imgur.com/ArNR4.png" alt="alt text"></p>