diff options
-rw-r--r-- | python2/futures/process.py | 4 | ||||
-rw-r--r-- | python3/futures/process.py | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/python2/futures/process.py b/python2/futures/process.py index e4c3ad3..fdea346 100644 --- a/python2/futures/process.py +++ b/python2/futures/process.py @@ -17,6 +17,7 @@ import weakref _thread_references = set() _shutdown = False +EXTRA_QUEUED_CALLS = 1 def _python_exit(): global _shutdown @@ -144,7 +145,8 @@ class ProcessPoolExecutor(Executor): # Make the call queue slightly larger than the number of processes to # prevent the worker processes from starving but to make future.cancel() # responsive. - self._call_queue = multiprocessing.Queue(self._max_processes + 1) + self._call_queue = multiprocessing.Queue(self._max_processes + + EXTRA_QUEUED_CALLS) self._result_queue = multiprocessing.Queue() self._work_ids = Queue.Queue() self._queue_management_thread = None diff --git a/python3/futures/process.py b/python3/futures/process.py index 75ee83c..af6e6be 100644 --- a/python3/futures/process.py +++ b/python3/futures/process.py @@ -18,6 +18,7 @@ import weakref _thread_references = set() _shutdown = False +EXTRA_QUEUED_CALLS = 1 def _python_exit(): global _shutdown @@ -143,7 +144,8 @@ class ProcessPoolExecutor(Executor): # Make the call queue slightly larger than the number of processes to # prevent the worker processes from starving but to make future.cancel() # responsive. - self._call_queue = multiprocessing.Queue(self._max_processes + 1) + self._call_queue = multiprocessing.Queue(self._max_processes + + EXTRA_QUEUED_CALLS) self._result_queue = multiprocessing.Queue() self._work_ids = queue.Queue() self._queue_management_thread = None |