文件名称:producer-and-consumer
-
所属分类:
- 标签属性:
- 上传时间:2013-11-25
-
文件大小:1.14kb
-
已下载:1次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
创建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
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.