php消息队列
使用共享内存队列实现 点击查看原文地址
?
利用PHP操作Linux消息队列完成进程间通信
当我们开发的系统需要使用多进程方式运行时,进程间通信便成了至关重要的环节。消息队列(message queue)是Linux系统进程间通信的一种方式。
关于Linux系统进程通信的概念及实现可查看:http://www.ibm.com/developerworks/cn/linux/l-ipc/
关于Linux系统消息队列的概念及实现可查看:http://www.ibm.com/developerworks/cn/linux/l-ipc/part4/
PHP的sysvmsg模块是对Linux系统支持的System V IPC中的System V消息队列函数族的封装。我们需要利用sysvmsg模块提供的函数来进进程间通信。先来看一段示例代码_1:
运行结果为:No.0 child process was created, the pid is 5249No.1 child process was created, the pid is 5250No.2 child process was created, the pid is 5251No.3 child process was created, the pid is 5252No.4 child process was created, the pid is 5253process.5251 is writing nowthis is process.5251's dataprocess.5253 is writing nowprocess.5252 is writing nowprocess.5250 is writing nowthis is process.5253's datathis is process.5252's datathis is process.5250's dataprocess.5249 is writing nowthis is process.5249's dataredis
http://www.neatstudio.com/show-976-1.shtml?
php自带的三个消息队列相关的函数
http://www.zhangguangda.com/?p=89?