title: Python: can a child process pause/resume the parent
body: <p>I'm trying to make a temperature monitoring module that saves the current temperature to a file continuously, and then uses matplotlib to draw a graph once whatever it was being used for finishes. I've got this functionality working, so I can use it like:</p>
  
  <pre><code>with TemperatureMonitoring():
      # do stuff
  </code></pre>
  
  <p>When <code>__enter__</code> get called the process gets started, which is just an infinite loop that sleeps and writes to a file, and when <code>__exit__</code> gets called the process is terminated and the file is plotted to the screen.</p>
  
  <p>Now I want to make improvements, and so I'd like to make the child process control the parent; if the temperature gets too high for too long it will pause and wait for the computer to cool. This is my first time with the <code>multiprocessing</code> module, but it seems like if I pause the main process the child also gets paused. So if I do reach a critical state it won't be able to unpause itself. So the parent needs to be able to terminate the child when the code finished execution, and the child needs to be able to pause/resume the parent if necessary. Is there an obvious way to accomplish this?</p>