title: Python multiprocessing queue makes code hang with large data
body: <p>I'm using python's multiprocessing to analyse some large texts. After some days trying to figure out why my code was hanging (i.e. the processes didn't end), I was able to recreate the problem with the following simple code:</p>
  
  <pre><code>import multiprocessing as mp
  
  for y in range(65500, 65600):
      print(y)
  
      def func(output):
  
           output.put("a"*y)
  
      if __name__ == "__main__":
  
          output = mp.Queue()
  
          process = mp.Process(target = func, args = (output,))
  
          process.start()
  
          process.join()
  </code></pre>
  
  <p>As you can see, if the item to put in the queue gets too large, the process just hangs.
  It doesn't freeze, if I write more code after <code>output.put()</code> it will run, but still, the process never stops.</p>
  
  <p>This starts happening when the string gets to 65500 chars, depending on your interpreter it may vary.</p>
  
  <p>I was aware that <code>mp.Queue</code> has a <code>maxsize</code> argument, but doing some search I found out it is about the Queue's size in number of items, not the size of the items themselves.</p>
  
  <p>Is there a way around this?
  The data I need to put inside the Queue in my original code is very very large...</p>