Chinaunix首页 | 论坛 | 博客
  • 博客访问: 185392
  • 博文数量: 40
  • 博客积分: 1900
  • 博客等级: 上尉
  • 技术积分: 450
  • 用 户 组: 普通用户
  • 注册时间: 2008-07-06 21:31
文章分类
文章存档

2009年(16)

2008年(24)

我的朋友

分类:

2008-09-24 11:26:28

from APUE.

After comparing the timing of message queues versus full-duplex pipes, and semaphores versus record locking, we can make the following recommendations: learn pipes and FIFOs, since these two basic techniques can still be used effectively in numerous applications. Avoid using message queues and semaphores in any new applications. Full-duplex pipes and record locking should be considered instead, as they are far simpler. Shared memory still has its use, although the same functionality can be provided through the use of the mmap function 。

虽然sockaddr_un也比较傻,却是用着最舒服的,不论从概念还是从代码上都很好理解。

当然,现在有了更好的dbus,不过对其API实在不敢恭维,基本上每行代码都要分几行来写,大概是中了glib/gtk的语法流毒啦。

我周围的几个兄弟们倒是倾向于socket,当然也包括我在内。也有可能是不需要学习新的知识吧。

总是,dbus很好,但用起来很不爽,而且,对付频繁的交互也不爽。如果两端都是自己的,不是要做通用的玩意,还是socket吧。

上面可没说共享内存啊,有些场合,共享内存还是很重要地,比如,修改一个X的驱动,加上对他的一些控制,然后用外部程序进行设定。


阅读(686) | 评论(0) | 转发(0) |
0

上一篇:pthread_cleanup_*

下一篇:pthread_kill

给主人留下些什么吧!~~