Skip to content

Commit

Permalink
Update some docs
Browse files Browse the repository at this point in the history
  • Loading branch information
csm10495 committed Dec 17, 2024
1 parent 4b285b8 commit b4939fd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Doc/library/concurrent.futures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,19 @@ to a :class:`ProcessPoolExecutor` will result in deadlock.
require the *fork* start method for :class:`ProcessPoolExecutor` you must
explicitly pass ``mp_context=multiprocessing.get_context("fork")``.

.. method:: terminate_workers(signal=signal.SIGTERM)

Attempt to terminate all living worker processes immediately by sending each
of them the given signal. If the signal is not specified, the default signal
:data:`signal.SIGTERM` is used.

After calling :meth:`ProcessPoolExecutor.terminate_workers`, the caller, should
no longer submit tasks to the executor. It is also recommended to still call
:meth:`ProcessPoolExecutor.shutdown` to ensure that all other resources
associated with the executor are freed.

.. versionadded:: 3.14

.. _processpoolexecutor-example:

ProcessPoolExecutor Example
Expand Down
3 changes: 3 additions & 0 deletions Doc/whatsnew/3.14.rst
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,9 @@ concurrent.futures
incompatible *fork* start method you must explicitly request it by
supplying a *mp_context* to :class:`concurrent.futures.ProcessPoolExecutor`.
(Contributed by Gregory P. Smith in :gh:`84559`.)
* Add :meth:`concurrent.futures.ProcessPoolExecutor.terminate_workers` as
a way to terminate all living worker processes in the given pool.
(Contributed by Charles Machalow in :gh:`128043`.)

ctypes
------
Expand Down

0 comments on commit b4939fd

Please sign in to comment.