随笔分类 - 操作系统
摘要:放几个IPC学习的连接。使用 UNIX System V IPC 机制共享应用程序数据http://www.ibm.com/developerworks/cn/aix/library/au-ipc/index.html消息队列http://dash1982.iteye.com/blog/296583python popen popen2http://linhs.blog.51cto.com/370259/126831
阅读全文
摘要:#define BUFFER_SIZE=10typedef struct{...}item;item buffer[BUFFER_SIZE];int in=0;int out=0;生产者:while(1){while((in+1)%BUFFER_SIZE==out);//缓冲满了,啥也不干buffer[in]=。。。in=(in+1)%BUFFER_SIZE;}消费者while(1){while(in==out);//缓冲没东西了,啥也不干nextConsumed=buffer[out];out=(out+1)%BUFFER_SIZE;}当in==out的时候,缓冲为空,当(in+1)%BUF
阅读全文