[issue18277] Queue is empty right after put from the same process/thread

2013-06-24 Thread Richard Oudkerk
Changes by Richard Oudkerk : -- assignee: -> docs@python components: +Documentation -IO, Interpreter Core nosy: +docs@python resolution: -> fixed stage: -> committed/rejected status: open -> closed type: behavior -> ___ Python tracker

[issue18277] Queue is empty right after put from the same process/thread

2013-06-24 Thread Richard Oudkerk
Richard Oudkerk added the comment: > 1. "but should not cause any pratical difficulties" <-- you have a typo in > 'pratical' there. > 2. What exactly do you mean by "managed" queues in the new addition? Woops. Fixed now see 860fc6a2bd21, 347647a1f798. A managed queue is one created like

[issue18277] Queue is empty right after put from the same process/thread

2013-06-24 Thread shwouchk
shwouchk added the comment: I agree it might be less efficient, but sometimes it is the price to pay for greater generality/simplicity. After all, If I *really* wanted efficiency perhaps I would have written everything in C++. Anyway, thanks! n.p. 1. "but should not cause any pratical diffic

[issue18277] Queue is empty right after put from the same process/thread

2013-06-24 Thread Richard Oudkerk
Richard Oudkerk added the comment: > I did this to use the same abstraction that was used extensively for > other purposes, instead of recreating the same abstraction with a deque > as its basis. So you wanted a FIFO queue and preferred the API of Queue to that of deque? Well it will be *mu

[issue18277] Queue is empty right after put from the same process/thread

2013-06-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8dcc4e017d42 by Richard Oudkerk in branch '2.7': Issue #18277: Document quirks of multiprocessing queue. http://hg.python.org/cpython/rev/8dcc4e017d42 New changeset 0f921e73433a by Richard Oudkerk in branch '3.3': Issue #18277: Document quirks of mu

[issue18277] Queue is empty right after put from the same process/thread

2013-06-21 Thread shwouchk
shwouchk added the comment: Also, of course I did this or I would not have stumbled into this issue... -- ___ Python tracker ___ ___ P

[issue18277] Queue is empty right after put from the same process/thread

2013-06-21 Thread shwouchk
shwouchk added the comment: Richard, I think you missed my point. First, yes I did do that. Second ("the point"): I did this to use the same abstraction that was used extensively for other purposes, instead of recreating the same abstraction with a deque as its basis. Component reusability i

[issue18277] Queue is empty right after put from the same process/thread

2013-06-21 Thread Richard Oudkerk
Richard Oudkerk added the comment: Why would you use a multi-process queue to "pass messages from one part of the program to another part, in the same process and thread"? Why not just use a deque? Is this something you actually did, or are you just trying to come up with a plausible example

[issue18277] Queue is empty right after put from the same process/thread

2013-06-21 Thread shwouchk
shwouchk added the comment: The major difference with the issue you referenced is that the behavior in #17985 is clearly stated and warned against in the docs (Queue.Empty being inconsistent with Queue.size), whereas this is not. As for the actual behavior problem: Imagine you build an abstrac

[issue18277] Queue is empty right after put from the same process/thread

2013-06-21 Thread Richard Oudkerk
Richard Oudkerk added the comment: This is a very similar issue to #17985. While it may seem counter-intuitive, I don't see how it makes any difference. Another thread/process might remove the item before you can get it. I find it very difficult to imagine a real program where you can safely

[issue18277] Queue is empty right after put from the same process/thread

2013-06-21 Thread Ned Deily
Changes by Ned Deily : -- nosy: +sbt ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mai

[issue18277] Queue is empty right after put from the same process/thread

2013-06-21 Thread shwouchk
New submission from shwouchk: Consider this: $ python 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: q.put(1) q.get_nowai