文件名称:thread
-
所属分类:
- 标签属性:
- 上传时间:2016-04-01
-
文件大小:1.3kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
thrs_data结构中的几个变量用于读数据线程和显示线程的开始控制和结束控制。start_read:当二个线程同时启动或显示线程先启动时,保证读数据线程先使用缓冲区,=1表示读数据线程已使用了缓冲区;start_disp:在读数据线程对缓冲区进行第一轮操作时,当它已将2个缓冲区写满,而此时显示线程还没有启动或还没有使用过缓冲区,这时应将读数据线程阻塞住,防止它覆盖掉缓冲区中未显示的数据,=1表示显示线程已启动并已使用了缓冲区。在后续交替读数据和显示数据的过程中,由互斥锁来协调二个线程之间的关系。Flag:用于标识数据的结束,=1表示在缓冲区1上结束,=2表示在缓冲区2上结束。-Thrs_data structure of threads and several variable is used to read data to indicate the start of the thread control and end control.Start_read: when two threads start or display threads first start at the same time, ensure that read data line Mr. Cheng using buffer, = 1 said thread to read data have been used the buffer Start_disp: reading data thread on buffer for the first round of the operation, when it will have two buffer write full, while the thread has not been started or haven t used the buffer, then it should be a thread to read data block, prevent it covers off not shown in the buffer data, said = 1 shows that the thread has started and has used the buffer.In the subsequent alternate read data and display the data in the process, by the mutex to coordinate the relationship between the two threads.Flag: used to identify the end of the data, said = 1 at the end of the buffer 1, 2 = said at the end of the buffer zone 2.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
thread.cpp
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.