System V IPC vs POSIX IPC
2015-08-07 09:57
381 查看
Both have the same basic tools -- semaphores, shared memory and message queues. They offer a slightly different interface to those tools, but the basic concepts are the same. One notable difference is that POSIX offers some notification features for message
queues that Sys V does not. (See
Sys V IPC has been around for longer which has a couple of practical implications --
First, POSIX IPC is less widely implemented. I wrote a Python wrapper for POSIX IPC and its documentation
lists what I know about POSIX IPC implementations on various platforms.
On all of the platforms listed in that documentation, Sys V IPC is completely implemented AFAIK, whereas you can see the POSIX IPC is not.
The second implication of their relative age is that POSIX IPC was designed after Sys V IPC had been used for a while. Therefore, the designers of the POSIX API were able to learn from the strengths and weaknesses of the Sys V API. As a result the POSIX API
is simpler and easier to use IMO, and I recommend it over the Sys V API.
I should note that I've never run any performance tests to compare the two. I would think that the older API (Sys V) would have had more time to be performance tuned, but that's just speculation which is of course no substitute for real-world testing.
As to why there are two standards -- POSIX created their standard because they thought it was an improvement on the Sys V standard. But if everyone agreed that POSIX IPC is better, many many many programs still use Sys V IPC and it would take years to port
them all to POSIX IPC. In practice, it would not be worth the effort so even if all new code used POSIX IPC as of tomorrow, Sys V IPC would stick around for many years.
We can't tell you which you should use without knowing a lot more about what you intend to do, but the answers you have here should give you enough information to decide on your own.
http://stackoverflow.com/questions/4582968/system-v-ipc-vs-posix-ipc
queues that Sys V does not. (See
mq_notify().)
Sys V IPC has been around for longer which has a couple of practical implications --
First, POSIX IPC is less widely implemented. I wrote a Python wrapper for POSIX IPC and its documentation
lists what I know about POSIX IPC implementations on various platforms.
On all of the platforms listed in that documentation, Sys V IPC is completely implemented AFAIK, whereas you can see the POSIX IPC is not.
The second implication of their relative age is that POSIX IPC was designed after Sys V IPC had been used for a while. Therefore, the designers of the POSIX API were able to learn from the strengths and weaknesses of the Sys V API. As a result the POSIX API
is simpler and easier to use IMO, and I recommend it over the Sys V API.
I should note that I've never run any performance tests to compare the two. I would think that the older API (Sys V) would have had more time to be performance tuned, but that's just speculation which is of course no substitute for real-world testing.
As to why there are two standards -- POSIX created their standard because they thought it was an improvement on the Sys V standard. But if everyone agreed that POSIX IPC is better, many many many programs still use Sys V IPC and it would take years to port
them all to POSIX IPC. In practice, it would not be worth the effort so even if all new code used POSIX IPC as of tomorrow, Sys V IPC would stick around for many years.
We can't tell you which you should use without knowing a lot more about what you intend to do, but the answers you have here should give you enough information to decide on your own.
http://stackoverflow.com/questions/4582968/system-v-ipc-vs-posix-ipc
相关文章推荐
- 最佳路由选择的原则与步骤————管理距离和度量值
- UVA 11020 Efficient Solutions+multiset的应用
- RegionServer功能职责
- sesearch
- oracle基本操作
- mysql忘记root密码的解决方法
- MySql更新优化策略
- 南邮 OJ 1912 E.V.O.L
- css 曲线阴影
- Triangle
- 动态规划 uva 1025
- Eclipse安装Freemarker Editor插件
- Java中的值传递和引用传递
- toad for oracle中文显示乱码
- toad for oracle中文显示乱码
- Centos7.1.1503中文编码下,tomcat service命令不支持UTF-8
- (C/C++学习笔记)Copy构造函数应用场景
- ionic 项目中创建侧边栏的具体流程分4步简单学会
- MFC DLL 的生成与使用
- 阶层