简体   繁体   English

适用于POSIX兼容系统的Python流程的IPC解决方案

[英]IPC solutions for Python processes on POSIX compliant system

I have two Python processes that need to communicate with each other on POSIX complaint system, as an IPC I thought that using a named pipe would be the easiest solution, however since I'm new with Python I suspect there are more options available. 我有两个需要在POSIX投诉系统上相互通信的Python进程,作为IPC我认为使用命名管道将是最简单的解决方案,但是因为我是Python的新手,我怀疑有更多选项可用。 Anyone care to make a recommendation, besides a named pipe? 除了命名管道之外,还有人提出建议吗?

Thanks in advance, 提前致谢,

John 约翰

I would recommend you sticking with named pipes , if the system is POSIX compliant. 如果系统符合POSIX标准,我建议您坚持使用named pipes That being said, there are plenty of options, you could, open a tcp socket and send pickled data, but performance, you would not beat shared memory/named pipe, and why look for a "new" solution if there already exists well defined working solutions? 话虽这么说,有很多选择,你可以,打开一个tcp套接字并发送pickle数据,但性能,你不会打败共享内存/命名管道,为什么寻找一个“新的”解决方案,如果已经定义良好工作方案?

You could also look at this module , seems to be using shared memory, I have not tried it but it looks like an option. 你也可以看一下这个模块 ,似乎是在使用共享内存,我还没有尝试过,但它看起来像一个选项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM