title: Python threading deadlock
body: <p>I have two threads (producer and consumer) and I share the data with <code>Queue</code>. The problem is, that when I forcefully abort the producer, the consumer sometimes locks.</p>
  
  <p>I read in the docs that canceling a thread with queue might corrupt the queue and cause deadlock. I don't acquire any locks explicitly but reading the source of Queue.py says that <code>put</code> and <code>get</code> are doing so.</p>
  
  <p>Please, does anyone know of it might be the case that when I abort the thread, it might be in the middle of <code>get</code>/<code>put</code>, i.e. using the lock and then not releasing it? What can I do about it? I sometimes need to terminate the producer prematurely. Would using processes, instead of threads, make any difference?</p>