LinuxProcessCommunication
所属分类:Linux/Unix编程
开发工具:Unix_Linux
文件大小:34KB
下载次数:23
上传日期:2008-12-18 12:11:17
上 传 者:ZHANG
说明: 创建两个生产者进程和两个消费者进程,生产者进程a需要生成10000个整数,每次都将自己的进程号(用getpid()函数获得)和生成的整数放入共享内存中(共享内存大小为64Byte)。生产者b每次从26个英文字母中选一个,并将自己的进程号和选中的字母放入共享内存中,直到26个字母全部都选中。消费者进程c负责从共享内存中读取数据生产者进程a的数据并且将这些数据写入文件a.out。消费者进程d从共享内存读取进程b的数据后写入b.out中。
(The process of the creation of two producers and two consumers process, producers process a need to generate 10,000 integers, each of its own process (using getpid () function to obtain) and generated integer Add shared memory ( shared memory size of 64Byte). Producer b each 26 letters of the alphabet from a selected and the process of their own and select Add shared memory of the letters until all 26 letters selected. C is responsible for the consumer process to read from shared memory data producers and the process of a data write to file these data a.out. Consumer process d from the process of shared memory to read the data b in b.out write.)
文件列表:[举报垃圾]
Linux进程通信的系统调用--实现生产者和消费者问题
近期下载者:
相关文件:
收藏者: