Linux Zero-Copy: Transfer memory pages between two processes with vmsplice

后端 未结 1 646
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-04 02:06

Currently, I am trying to understand the value of splice/vmsplice. Regarding the use case of IPC, I stumbled upon the following answer on stackoverflow: https://stackoverflow.co

相关标签:
1条回答
  • 2021-02-04 02:59

    As R.. mentioned, you only need to pass the fd to the receiving process somehow and on the other side use it as a normal fd.

    edit: Actually, you have to use vmsplice() on the sending side to map the buffer to the pipe and splice() on the receiving side on the other end of the pipe. See an example here.

    Another choice would be to use a shared mmap-ing.

    0 讨论(0)
提交回复
热议问题