[New-bugs-announce] [issue18277] Queue is empty right after put from the same process/thread
report at bugs.python.org
Fri Jun 21 13:30:16 CEST 2013
New submission from shwouchk:
Python 2.7.4 (default, Apr 19 2013, 18:28:01)
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import multiprocessing as mp
>>> q = mp.Queue()
>>> while True:
Traceback (most recent call last):
File "<stdin>", line 3, in <module>
File "/usr/lib/python2.7/multiprocessing/queues.py", line 152, in get_nowait
File "/usr/lib/python2.7/multiprocessing/queues.py", line 134, in get
I believe that similar behavior could be seen in cPython 2.7.3 with the Queue.Queue implementation, but I can't reproduce it now and don't have the old version to test. And it is irrelevant anyway since it work "correctly" now.
I think this behavior is counter intuitive and hampers the development of code that performs stuff with queues in a generic way and works in both single and multi-process environments.
components: IO, Interpreter Core
title: Queue is empty right after put from the same process/thread
versions: Python 2.7
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce