使用多处理作为本地 IPC
我正在考虑使用 Python 的多处理包 在本地 python 程序之间进行消息传递。
这似乎是正确的方法,如果:
- 程序将始终在同一台机器(和相同的操作系统实例)上本地运行
- 程序的实现将保留在 Python 中
- 速度很重要
是否有可能 python 进程独立运行用户,即一个没有产生另一个?
怎么办?
文档似乎只给出了其中一个产生另一个的情况的示例。
I'm considering using Python's multiprocessing package for messaging between local python programs.
This seems like the right way to go IF:
- The programs will always run locally on the same machine (and same OS instance)
- The programs' implementation will remain in Python
- Speed is important
Is it possible in case the python processes were run independently by the user, i.e. one did not spawn the other?
How?
The docs seem to give examples only of cases where one spawns the other.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请参阅监听器和客户端
See Listeners and Clients
多重处理允许具有 远程并发。
是或否。您可以将另一个命令包装在 python 函数中。这将起作用,例如:
这取决于许多因素:
我不是这个主题的专家,但我通过使用文件交换数据实现了类似的东西[基本上一个进程的输出文件被另一个进程作为输入源监视,反之亦然]。
哈!
Multiprocessing allows to have remote concurrency.
Yes and no. You could wrap another command in a python function. This will work, for example:
That depends from a number of factors:
I'm not an expert on the subject, but I implemented something similar once by using files to exchange data [basically one process' output file was monitored as input source by the other, and vice-versa].
HTH!