“选择"在多个 Python 多处理队列上? [英] "select" on multiple Python multiprocessing Queues?

查看:31
本文介绍了“选择"在多个 Python 多处理队列上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

等待(不旋转)的最佳方法是什么,直到在两个(多处理)中的任何一个中可用队列,它们都驻留在同一个系统上?

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?

推荐答案

看起来目前还没有官方的方法来处理这个问题.或者至少,不是基于此:

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

你可以尝试类似这篇文章所做的事情——访问底层管道文件句柄:

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

然后使用选择.

这篇关于“选择"在多个 Python 多处理队列上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆