[issue17985] multiprocessing Queue.qsize() and Queue.empty() with different results

Andre Dias report at bugs.python.org
Wed May 15 23:25:36 CEST 2013


Andre Dias added the comment:

But qsize() is working. what is not working is empty()

2013/5/15 Richard Oudkerk <report at bugs.python.org>

>
> Richard Oudkerk added the comment:
>
> >From the docs:
>
>  qsize()
>     Return the approximate size of the queue. Because of
>     multithreading/multiprocessing semantics, this number
>     is not reliable.
>
> Adding a short sleep before calling qsize() and empty() should make things
> appear to work.
>
> But really, there are no good reasons for using qsize() except for
> debugging.  The same applies to queue.Queue.
>
> ----------
> nosy: +sbt
>
> _______________________________________
> Python tracker <report at bugs.python.org>
> <http://bugs.python.org/issue17985>
> _______________________________________
>

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17985>
_______________________________________


More information about the Python-bugs-list mailing list