Richard Oudkerk added the comment:

On 15/05/2013 11:33pm, Andre Dias wrote:
> But the example program has no races, no threads, nothing.
> empty() is returning TRUE even though qsize() is >0 (which actually is)
> And it happens almost every time I run that small example.
> I had read the module doc, and I know its an unreliable method, but man,
> the example program is too simple to fail
> Truth is I decided qsize() is more reliable and im using it in my programs,
> but man empty() problem is so ridiculous that I decided to submit here

If you assume everything is single-threaded then you would assume that 
this is too simple to fail.  But there *is* more than thread involved.

empty() and qsize() are basically redundant.  You would almost certainly 
be better off using get_noblock()/put_noblock() and catching Empty/Full.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17985>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to