Linux创建两个生产者进程,LinuxProcessCommunication

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进程通信的系统调用--实现生产者和消费者问题

近期下载者:

相关文件:

收藏者:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值