[issue36242] ABC: We ask U.S. news media to interview Human Rights expert Alfred de Zayas about Venezuela.
New submission from Andre Dias : Olá, Eu acabei de assinar o abaixo-assinado "ABC: We ask U.S. news media to interview Human Rights expert Alfred de Zayas about Venezuela." e queria saber se você pode ajudar assinando também. A nossa meta é conseguir 1.000 assinaturas e precisamos de mais apoio. Você pode ler mais sobre este assunto e assinar o abaixo-assinado aqui: http://chng.it/nnZvDGFYh4 Obrigado! Andre -- messages: 337508 nosy: aod priority: normal severity: normal status: open title: ABC: We ask U.S. news media to interview Human Rights expert Alfred de Zayas about Venezuela. ___ Python tracker <https://bugs.python.org/issue36242> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17985] multiprocessing Queue.qsize() and Queue.empty() with different results
New submission from Andre Dias: The problem is that Queue.empty() is True even if Queue.qsize()>0! #!/usr/bin/python from multiprocessing import Queue numbers=Queue() for i in range (0,10): numbers.put(i) if numbers.qsize()>0 and numbers.empty(): print "BUG?!" -- components: Extension Modules messages: 189302 nosy: aod priority: normal severity: normal status: open title: multiprocessing Queue.qsize() and Queue.empty() with different results versions: Python 2.7 ___ Python tracker <http://bugs.python.org/issue17985> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17985] multiprocessing Queue.qsize() and Queue.empty() with different results
Andre Dias added the comment: But qsize() is working. what is not working is empty() 2013/5/15 Richard Oudkerk > > 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 > <http://bugs.python.org/issue17985> > ___ > -- ___ Python tracker <http://bugs.python.org/issue17985> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17985] multiprocessing Queue.qsize() and Queue.empty() with different results
Andre Dias added the comment: RIchard, 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 2013/5/15 Richard Oudkerk > > Richard Oudkerk added the comment: > > On 15/05/2013 10:25pm, Andre Dias wrote: > > But qsize() is working. what is not working is empty() > > empty() returns False when there is data in the underlying pipe. But > the data does not enter the pipe until a background thread has written > it to the pipe. This should not cause any problems. > > Using Queue.empty() is always subject to races. It is just that the > multiprocessing version has an additional type of race compared to the > normal one. > > -- > > ___ > Python tracker > <http://bugs.python.org/issue17985> > ___ > -- ___ Python tracker <http://bugs.python.org/issue17985> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com