LoginSignup
0
0

More than 1 year has passed since last update.

pythonのmultiprocessing.Queueのempty()メソッドは危険

Posted at

表題の通り危険なので利用を避けるべきです.
これは公式でも言及されている内容です.

代わりに以下のように判定します.

if queue.qsize() == 0:
    # 理想的には queue.empty() と同じ結果
    # 実際には様々な問題からそうとは限らない
    # 処理

参考:Why queue is not multiprocessing safe?

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0