From a0f0a22b38c97bb4dcdaaa8b04a0577018803b95 Mon Sep 17 00:00:00 2001 From: saggarwal145 Date: Sat, 19 Jul 2025 12:28:47 +0100 Subject: [PATCH 1/2] clarify multiprocessing.Queue close() --- Doc/library/multiprocessing.rst | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst index 546876bd925db0..346e5b38534895 100644 --- a/Doc/library/multiprocessing.rst +++ b/Doc/library/multiprocessing.rst @@ -936,8 +936,13 @@ For an example of the usage of queues for interprocess communication see .. method:: close() - Indicate that no more data will be put on this queue by the current - process. The background thread will quit once it has flushed all buffered + Close the queue: release internal resources. + + A queue must not be used anymore after it is closed. For example, + :meth:`get`, :meth:`put` and :meth:`empty` methods must no longer be + called. + + The background thread will quit once it has flushed all buffered data to the pipe. This is called automatically when the queue is garbage collected. From 6c4258cfb16d4e0ef923238b8669bfbad58d856b Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Sat, 19 Jul 2025 14:09:09 +0200 Subject: [PATCH 2/2] Update Doc/library/multiprocessing.rst --- Doc/library/multiprocessing.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst index 346e5b38534895..c80f78e614818e 100644 --- a/Doc/library/multiprocessing.rst +++ b/Doc/library/multiprocessing.rst @@ -939,8 +939,8 @@ For an example of the usage of queues for interprocess communication see Close the queue: release internal resources. A queue must not be used anymore after it is closed. For example, - :meth:`get`, :meth:`put` and :meth:`empty` methods must no longer be - called. + :meth:`~Queue.get`, :meth:`~Queue.put` and :meth:`~Queue.empty` + methods must no longer be called. The background thread will quit once it has flushed all buffered data to the pipe. This is called automatically when the queue is garbage pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy