Home  >  Q&A  >  body text

多线程 - 为何 python condition acquire 会阻塞线程?

PHP中文网PHP中文网2741 days ago358

reply all(2)I'll reply

  • 大家讲道理

    大家讲道理2017-04-18 09:39:29

    Queue comes with its own lock

    If you use another lock, it is easy to cause a deadlock~

    Also, you need to change sleep to cond.wait(), so that notify() will work~

    reply
    0
  • PHP中文网

    PHP中文网2017-04-18 09:39:29

    After reading the document for a long time, the RLock written above only has the reentrant feature in a thread

    Reference: https://docs.python.org/2/lib...

    reply
    0
  • Cancelreply