zxo> import Queue
    zxo> b = Queue.Queue(0)
    zxo> b.put(9999)
    zxo> b.get()   # this is ok, it pops out 9999
    zxo> b.get()   # this one does not return anything and is hang on there

    zxo> Anybody knows what is going on with the second b.get()?

Queue objects are meant to be used in a multithreaded application.  By
default, when the Queue is empty, a consumer calling get() will block until
a producer put()s something else into it.  From the documentation:

    get([block[, timeout]])
        Remove and return an item from the queue. If optional args block is
        true and timeout is None (the default), block if necessary until an
        item is available....

Skip
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to