mmap是在进程之间进行通信的最佳方式吗?

编程入门 行业动态 更新时间:2024-10-28 13:19:25
本文介绍了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是在进程之间进行通信的最佳方式吗?

本文发布于:2023-08-02 18:05:38,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1279965.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:是在   进程   通信   方式   mmap

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!