title: How to terminate a multiprocess in python when a given condition is met?
body: <p>Let's say I have the function:</p>
  
  <pre><code>def f():  
      while True:          
          x = generate_something()  
          if x == condition:  
              return x
  
  if __name__ == '__main__':
      p=Pool(4)
  </code></pre>
  
  <p>I want to run this function in a multiprocess and when one of the processes meets my function's condition, I want all other processes to stop.</p>