cpython/Lib/concurrent/futures
Charles Machalow f97e4098ff
gh-128041: Add terminate_workers and kill_workers methods to ProcessPoolExecutor (GH-128043)
This adds two new methods to `multiprocessing`'s `ProcessPoolExecutor`:
- **`terminate_workers()`**: forcefully terminates worker processes using `Process.terminate()`
- **`kill_workers()`**: forcefully kills worker processes using `Process.kill()`

These methods provide users with a direct way to stop worker processes without `shutdown()` or relying on implementation details, addressing situations where immediate termination is needed.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Commit-message-mostly-authored-by: Claude Sonnet 3.7 (because why not -greg)
2025-03-02 18:01:45 -08:00
..
__init__.py gh-124694: Add concurrent.futures.InterpreterPoolExecutor (gh-124548) 2024-10-16 16:50:46 -06:00
_base.py gh-120157: Remove unused code in concurrent.future (gh-120187) 2024-06-07 16:39:19 +09:00
interpreter.py gh-125864: Propagate pickle.loads() failures in InterpreterPoolExecutor (gh-125898) 2024-10-24 10:51:45 -06:00
process.py gh-128041: Add terminate_workers and kill_workers methods to ProcessPoolExecutor (GH-128043) 2025-03-02 18:01:45 -08:00
thread.py gh-88110: Clear concurrent.futures.thread._threads_queues after fork to avoid joining parent process' threads (GH-126098) 2024-11-22 18:20:34 +02:00