mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
Issue 14976: Note that the queue module is not designed to protect against reentrancy
This commit is contained in:
parent
7b3b3dc85d
commit
87dc4d6189
1 changed files with 2 additions and 5 deletions
|
@ -22,6 +22,8 @@ the first retrieved (operating like a stack). With a priority queue,
|
||||||
the entries are kept sorted (using the :mod:`heapq` module) and the
|
the entries are kept sorted (using the :mod:`heapq` module) and the
|
||||||
lowest valued entry is retrieved first.
|
lowest valued entry is retrieved first.
|
||||||
|
|
||||||
|
Internally, the module uses locks to temporarily block competing threads;
|
||||||
|
however, it is not designed to handle reentrancy within a thread.
|
||||||
|
|
||||||
The :mod:`queue` module defines the following classes and exceptions:
|
The :mod:`queue` module defines the following classes and exceptions:
|
||||||
|
|
||||||
|
@ -186,11 +188,6 @@ Example of how to wait for enqueued tasks to be completed::
|
||||||
t.join()
|
t.join()
|
||||||
|
|
||||||
|
|
||||||
.. note::
|
|
||||||
|
|
||||||
The :mod:`queue` module is not safe for use from :mod:`signal` handlers as
|
|
||||||
it uses :mod:`threading` locks.
|
|
||||||
|
|
||||||
.. seealso::
|
.. seealso::
|
||||||
|
|
||||||
Class :class:`multiprocessing.Queue`
|
Class :class:`multiprocessing.Queue`
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue