diff Doc/lib/libqueue.tex @ 32624:73016bd01a71 legacy-trunk

Bug #788520: Queue class has logic error when non-blocking I don't agree it had a bug (see the report), so this is *not* a candidate for backporting, but the docs were confusing and the Queue implementation was old enough to vote. Rewrote put/put_nowait/get/get_nowait from scratch, to use a pair of Conditions (not_full and not_empty), sharing a common mutex. The code is 1/4 the size now, and 6.25x easier to understand. For blocking with timeout, we also get to reuse (indirectly) the tedious timeout code from threading.Condition. The Full and Empty exceptions raised by non-blocking calls are now easy (instead of nearly impossible) to explain truthfully: Full is raised if and only if the Queue truly is full when the non-blocking put call checks the queue size, and similarly for Empty versus non-blocking get. What I don't know is whether the new implementation is slower (or faster) than the old one. I don't really care. Anyone who cares a lot is encouraged to check that.
author Tim Peters <tim.peters@gmail.com>
date Mon, 12 Jul 2004 00:45:14 +0000
parents 63fa60f2d61c
children bed3f52f0dc6
line wrap: on
line diff
--- a/Doc/lib/libqueue.tex	Sun Jul 11 19:26:19 2004 +0000
+++ b/Doc/lib/libqueue.tex	Mon Jul 12 00:45:14 2004 +0000
@@ -26,13 +26,13 @@
 \begin{excdesc}{Empty}
 Exception raised when non-blocking \method{get()} (or
 \method{get_nowait()}) is called on a \class{Queue} object which is
-empty or locked.
+empty.
 \end{excdesc}
 
 \begin{excdesc}{Full}
 Exception raised when non-blocking \method{put()} (or
 \method{put_nowait()}) is called on a \class{Queue} object which is
-full or locked.
+full.
 \end{excdesc}
 
 \subsection{Queue Objects}
@@ -51,7 +51,7 @@
 
 \begin{methoddesc}{empty}{}
 Return \code{True} if the queue is empty, \code{False} otherwise.
-Becauseof multithreading semantics, this is not reliable.
+Because of multithreading semantics, this is not reliable.
 \end{methoddesc}
 
 \begin{methoddesc}{full}{}