“select” on multiple Python multiprocessing Queues?

前端 未结 8 1529
情书的邮戳
情书的邮戳 2020-12-24 01:55

What\'s the best way to wait (without spinning) until something is available in either one of two (multiprocessing) Queues, where both reside on the same system?

8条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-24 02:24

    It doesn't look like there's an official way to handle this yet. Or at least, not based on this:

    • http://bugs.python.org/issue3831

    You could try something like what this post is doing -- accessing the underlying pipe filehandles:

    • http://haltcondition.net/?p=2319

    and then use select.

提交回复
热议问题