所属分类:
操作系统开发
开发工具:C/C++
文件大小:2KB
下载次数:0
上传日期:2019-11-04 22:01:13
说明: 创建5个进程,其中两个进程为生产者进程,3个进程为消费者进程。一个生产者进程试图不断地在一个缓冲中写入大写字母,另一个生产者进程试图不断地在缓冲中写入小写字母。3个消费者不断地从缓冲中读取一个字符并输出。为了使得程序的输出易于看到结果,分别在生产者和消费者进程的合适的位置加入一些随机睡眠时间。
(Create five processes, two of which are producer processes and three consumer processes. One producer process tries to keep writing upper case letters in one buffer and another producer process tries to keep writing lower case letters in the buffer. Three consumers constantly read a character from the buffer and output it. In order to make the output of the program easy to see the results, some random sleep times are added to the appropriate positions of the producer and consumer processes respectively.)
文件列表:
comsumer.c, 2207 , 2019-10-29