0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?