Performance of sockets vs pipes

廉价感情. 提交于 2019-12-01 04:52:15

Ken is right. Named pipes are definitely faster on Windows. On UNIX & Linux, you'd want a UDS or local pipe. Same thing, different name.

Anything other than sockets will be faster for local communication. This includes memory mapped files, local pipes, shared memory, COM, etc.

The first google hit turned up this, which clocked NT4 and XP and found named pipes (that's what you meant, right?) to be faster on Windows.

For local process communication pipe are definitely the faster. Here is google's benchmark: https://sites.google.com/site/rikkus/sysv-ipc-vs-unix-pipes-vs-unix-sockets I think even though socket is flexible but it can also lead to bad code design. While using pipe it enforce you to design the whole structure of you project things like which process should be the parent which should be the children and how they cooperate(this will determine how pipes are established) and assign function to process. So it will design you whole project in a hierarchical way and easy to maintain.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!