Program blocked in Queue.Queue.get and Queue.Queue.put

Discussion in 'Python' started by Kris, Jan 4, 2012.

  1. Kris

    Kris Guest

    I have a program that is blocked and all threads are blocked on a
    Queue.Queue.get or Queue.Queue.put method (on the same Queue.Queue
    object).

    1 thread shows the below as its last entry in the stack:
    File: "c:\python27\lib\Queue.py", line 161, in get
    self.not_empty.acquire()

    2 threads show the below as its last entry in the stack:
    File: "c:\python27\lib\Queue.py", line 118, in put
    self.not_full.acquire()

    According to me, this means both the Queue.Queue.not_full and
    Queue.Queue.not_empty locks are taken, but no other thread seems to
    have it. Of course, I don't access the locks my self directly.

    I did send an KeyboardInterrupt to the main thread however. Could it
    be that it was at that moment doing a Queue.Queue.put and it got
    interrupted while it has the lock, but before it entered the try block
    with the finally that releases the lock (so between line 118 and 119
    in the Queue.py file)?

    If this is the case, how do I avoid that? Or is it a bug in the
    Queue.Queue class?
    If this is not the case, any clue what else could have happened?

    Thanks
     
    Kris, Jan 4, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Boki
    Replies:
    2
    Views:
    569
  2. Russell Warren

    Is Queue.Queue.queue.clear() thread-safe?

    Russell Warren, Jun 22, 2006, in forum: Python
    Replies:
    4
    Views:
    685
    Russell Warren
    Jun 27, 2006
  3. Replies:
    1
    Views:
    462
    Gavin Deane
    Mar 20, 2007
  4. Gabriel Rossetti
    Replies:
    3
    Views:
    555
    Jerry Hill
    Apr 25, 2008
  5. Nigel Molesworth

    Popups sometimes get blocked by IE

    Nigel Molesworth, Jul 2, 2005, in forum: Javascript
    Replies:
    7
    Views:
    255
Loading...

Share This Page