Lines Matching refs:executor
280 executor: A reference to the ProcessPoolExecutor that owns
283 the executor.
286 def __init__(self, executor):
287 # Store references to necessary internals of the executor.
291 self.thread_wakeup = executor._executor_manager_thread_wakeup
292 self.shutdown_lock = executor._shutdown_lock
297 # When the executor gets garbage collected, the weakref callback
308 self.executor_reference = weakref.ref(executor, weakref_cb)
311 self.processes = executor._processes
315 self.call_queue = executor._call_queue
318 self.result_queue = executor._result_queue
321 self.work_ids_queue = executor._work_ids
325 self.max_tasks_per_child = executor._max_tasks_per_child
329 self.pending_work_items = executor._pending_work_items
334 # Main loop for the executor manager thread.
356 if executor := self.executor_reference():
359 executor._adjust_process_count()
361 executor._idle_worker_semaphore.release()
362 del executor
405 # submitted, from the executor being shutdown/gc-ed, or from the
438 # (avoids marking the executor broken)
456 # Check whether we should start shutting down the executor.
457 executor = self.executor_reference()
460 # - The executor that owns this worker has been collected OR
461 # - The executor that owns this worker has been shutdown.
462 return (_global_shutdown or executor is None
463 or executor._shutdown_thread)
466 # Terminate the executor because it is in a broken state. The cause
468 # lead the executor into becoming broken.
471 executor = self.executor_reference()
472 if executor is not None:
473 executor._broken = ('A child process terminated '
476 executor._shutdown_thread = True
477 executor = None
504 # Flag the executor as shutting down and cancel remaining tasks if
506 executor = self.executor_reference()
507 if executor is not None:
508 executor._shutdown_thread = True
510 if executor._cancel_pending_futures:
527 executor._cancel_pending_futures = False
632 live as long as the executor. Requires a non-'fork' mp_context
698 # when calling executor.submit or executor.shutdown). We do not use the
706 # Create communication channels for the executor