mmap是在进程之间进行通信的最佳方式吗? [英] Is mmap the best way to communicate between processes?

查看:118
本文介绍了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是在进程之间进行通信的最佳方式吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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