文件名称:producer-and-consumer
介绍说明--下载内容均来自于网络,请自行研究使用
创建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.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
job5.txt