本文介绍了mmap是在进程之间进行通信的最佳方式吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用文件在Python和Ruby脚本之间进行通信.但是,我们有mmap.所以这是我的问题.
I use a file to communicate between Python and Ruby script. But, we have mmap. So here are my questions.
- 我可以使用mmap做同样的事情(进程之间的通信)吗?
- 与物理文件相比,mmap可以给我们带来什么优势?提速?
- 两个流程之间最简单的通信方式是什么?
- 两个流程之间最快的通信方式是什么?
与物理文件相比,mmap的一个优势确实是可以提高速度,但是任何东西都比物理文件要快!
one advantage of mmap over physical file is indeed speedup, but anything is going to be faster than a physical file !
与进程之间最简单的通信方式是管道或套接字.它们比较容易,因为它们是流,因此它们对进程之间可以交换的数据长度没有限制,这与文件或具有限制的mmap相反.
the easiest way to communicate between to processes is either a pipe or a socket. they are easier because they are streams, so they do not impose a limit on the length of the data you can exchange between the processes, contrary to a file or a mmap which have bounds.
更多推荐
mmap是在进程之间进行通信的最佳方式吗?
发布评论