Description: 计算机操作系统的生产者与消费者问题
一组生产者向一组消费者提供消息,它们共享一个有界缓冲池,生产者向其中投放消息,消费者从中取得消息。生产者要不断将数据放入共享的缓冲,消费者要不断从缓冲取出数据。消费者必须等生产者取走数据后才能再放新数据(不覆盖数据),消费者必须等生产者放入新数据后才能去取(不重复)。-computer operating system, the producer and a consumer group to a group of producers to provide consumers with information, they shared a bounded buffer pool, which put producers to news consumers to get news. Producers will continue to share the data into the buffer, consumers should continue to extract data from the buffer. Consumers must be removed so producers can recapture data after new data (not cover data), consumers must wait producers Add new data after Mysteriously (repetition). Platform: |
Size: 1663 |
Author:紫水晶 |
Hits:
Description: 计算机操作系统的生产者与消费者问题
一组生产者向一组消费者提供消息,它们共享一个有界缓冲池,生产者向其中投放消息,消费者从中取得消息。生产者要不断将数据放入共享的缓冲,消费者要不断从缓冲取出数据。消费者必须等生产者取走数据后才能再放新数据(不覆盖数据),消费者必须等生产者放入新数据后才能去取(不重复)。-computer operating system, the producer and a consumer group to a group of producers to provide consumers with information, they shared a bounded buffer pool, which put producers to news consumers to get news. Producers will continue to share the data into the buffer, consumers should continue to extract data from the buffer. Consumers must be removed so producers can recapture data after new data (not cover data), consumers must wait producers Add new data after Mysteriously (repetition). Platform: |
Size: 1024 |
Author:紫水晶 |
Hits:
Description: 程序实现了两个生产者和两个消费者的生产者消费者问题(当生产者消费者数目再多时加上几个子进程就可以了)为了防止程序陷入死循环,给生产者限定了生产次数,同时为了方便截图,将次数限定的比较少。下面是我的程序:-Procedures to achieve the two producers and two consumers and producers of consumer issues (when the number of producers of consumers to add a few more hours can be a sub-process) in order to prevent the program into a death cycle, to limit the production of the number of producers At the same time, for the convenience of shots, will be a limited number of relatively small. The following is my procedure: Platform: |
Size: 64512 |
Author:wangshan |
Hits:
Description: 生产者与消费者问题,用信号量实现!linux环境下的C代码-Producer and consumer issues, using semaphores to achieve! C code in linux environment Platform: |
Size: 1024 |
Author:flydragon |
Hits:
Description: 创建4个POSIX线程。其中2个线程(A和B)分别从2个数据文件(data1.txt和data2.txt)读取10个整数. 线程A和B把从文件中读取的逐一整数放入一个缓冲池. 缓冲池由n个缓冲区构成(n=5,并可以方便地调整为其他值),每个缓冲区可以存放一个整数。另外2个线程,C和D,各从缓冲池读取10数据。线程C、D每读出2个数据,分别求出它们的和或乘积,并打印输出。-Creating four POSIX threads. Where two threads (A and B) were read 10 integer from 2 data files (data1.txt and data2.txt). Individually integer thread A and B to read from a file into a buffer pool. Cushion buffer pool constituted by n (n = 5, and can be easily adjusted to other values), each buffer can store an integer. Further two threads, C and D, the data is read from the buffer pool 10. Thread C, D 2 data is read out of each, and are obtained separately, or product thereof, and print output. Platform: |
Size: 1024 |
Author:徐舒怡 |
Hits:
Description: 该程序是用c++写的一个生产者消费者问题的程序,使用的是windows下的进程同步,供大家参考和学习-The program is using c++ to write a program to producers and consumers, using a process under windows sync for reference and learning Platform: |
Size: 1024 |
Author:wenjian |
Hits:
Description: 这是关于操作系统中生产者消费者问题的一段代码,其中生产者和消费者问题是用信号量实现的,临界资源是用数组实现的。-This is a piece of code about the producer-consumer problem in the operating system, where producer and consumer problems are implemented with semaphores, and the critical resource is implemented as an array. Platform: |
Size: 2048 |
Author:宗道明 |
Hits: