title: Multiprocessing.pool.Pool on Windows: CPU limit of 63?
body: <p>When using python's multiprocessing.pool.Pool with more than 63 cores, I get a <code>ValueError</code>:</p>
  <pre><code>from multiprocessing.pool import Pool
  
  def f(x):
      return x
  
  if __name__ == '__main__':
      with Pool(70) as pool:
          arr = list(range(70))
          a = pool.map(f, arr)
          print(a)
  </code></pre>
  <p>Output:</p>
  <pre><code>Exception in thread Thread-1:
  Traceback (most recent call last):
    File &quot;C:\Users\fischsam\Anaconda3\lib\threading.py&quot;, line 932, in _bootstrap_inner
      self.run()
    File &quot;C:\Users\fischsam\Anaconda3\lib\threading.py&quot;, line 870, in run
      self._target(*self._args, **self._kwargs)
    File &quot;C:\Users\fischsam\Anaconda3\lib\multiprocessing\pool.py&quot;, line 519, in _handle_workers
      cls._wait_for_updates(current_sentinels, change_notifier)
    File &quot;C:\Users\fischsam\Anaconda3\lib\multiprocessing\pool.py&quot;, line 499, in _wait_for_updates
      wait(sentinels, timeout=timeout)
    File &quot;C:\Users\fischsam\Anaconda3\lib\multiprocessing\connection.py&quot;, line 879, in wait
      ready_handles = _exhaustive_wait(waithandle_to_obj.keys(), timeout)
    File &quot;C:\Users\fischsam\Anaconda3\lib\multiprocessing\connection.py&quot;, line 811, in _exhaustive_wait
      res = _winapi.WaitForMultipleObjects(L, False, timeout)
  ValueError: need at most 63 handles, got a sequence of length 72
  [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69]
  
  </code></pre>
  <p>The program seems to work fine; the result is just what I expected. Can I ignore the <code>ValueError</code>?</p>
  <p><em>Background</em>: I have googled this issue, and it seems having to do with limitations of python on Windows (<code>_winapi.WaitForMultipleObjects</code>); see e.g. <a href="https://stackoverflow.com/questions/54905588/exception-in-thread-queuemanagerthread-scikit-learn">here</a>. The suggested fix is to limit the number of used cores to 63. This is not satisfactory, because I want to 100+ cores on my server. Do I really need to limit the cores? Why? Is there a workaround?</p>