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

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

问题描述

=http://docs.python.org/library/multiprocessing.html#multiprocessing.Queue中的任何一个可用等待(而不是旋转)的最佳方式是什么? rel =noreferrer>队列,两者都驻留在同一个系统上。

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:

  • 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

然后使用select。

and then use select.

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

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