-
读者写者问题
说明: 1、定义一个数据缓存buffer及用于实现同步互斥的信号量。
2、定义一个读者函数:
?当有写者在占用buffer时,读者应该等待,直到写者不再使用该buffer。
?当有其他读者在占用buffer时,读者可对buffer进行读取操作。
?当buffer中有数据时,则从其中读取一个数据,并显示然后退出。
?当buffer中没有数据时,应等待,直到buffer中有数据可读。
3、定义一个写者函数
?当有读者在占用buffer时,写者应该等待,直到所有的读者都退出为止。
?当有其他写者占用buffer时,该写者应该等待,直到占用buffer的写者退出为止。
?当buffer有空闲时,写者应该在buffer中写入一个数据并退出。
?当buffer满时,写者应该等待,直到buffer有空闲为止。
4、定义主函数,在其中可以任意创建读者与写者。
可根据用户输入创建读者或写者进程(线程)。(1. Define a data buffer and semaphores for synchronization and mutual exclusion.
2. Define a reader function:
When a writer is occupying the buffer, the reader should wait until the writer no longer uses the buffer.
When other readers occupy the buffer, they can read the buffer.
When there is data in the buffer, read a data from it, display and exit.
When there is no data in the buffer, wait until the data in the buffer is readable.
3. Define a writer function
When a reader is occupying the buffer, the writer should wait until all readers quit.
When other writers occupy the buffer, the writer should wait until the writer who occupies the buffer exits.)
- 2019-12-27 18:49:46下载
- 积分:1
-
35个Delphi Indy编程实例包
35个Delphi Indy编程实例包,带源码,数了数,一共有35款,有一些带数据库的,个个精品,对学习Delphi的Indy编程相当有学习参考价值。
- 2022-04-12 09:48:34下载
- 积分:1
-
icolorbuffer
说明: Downloads of the software peaked in 2013 with an average of just under 148,000 per day compared to less than 50,000 in Q2 2019.(It can also read and write a wide variety of other file formats, with particular attention to those from)
- 2020-06-17 01:20:01下载
- 积分:1
-
配电系统可靠性计算
10负荷点配电网蒙特卡洛法可靠性计算程序,用于计算简单的给定的配电网,内容包含matlab与vs2010程序,以及配电网参数的说明。(10 load point distribution network Monte Carlo reliability calculation program is used to calculate a simple distribution network. The contents include MATLAB and VS2010 program, and the description of distribution network parameters.)
- 2021-03-10 21:39:26下载
- 积分:1
-
Quartus
QUARTUS-7.2的破解软件,可以破解QUARTUS-7.2,能用到2034年。-The crack QUARTUS-7.2 software, can crack QUARTUS-7.2, can be used to in 2034.
- 2022-03-24 14:50:21下载
- 积分:1
-
polar code3
极化码的编译码算法,包括各种函数说明,运行仿真,sc,scl都有(The encoding and decoding algorithm of polarizing codes includes various functions, operation simulation, SC and SCL.)
- 2018-04-11 10:29:45下载
- 积分:1
-
Java IO文件操作类与复制文件实例
Java IO文件操作类与复制文件实例,有关文本编辑、FileWriter文件写入、FileReade文件读娶DataStream文件数据流、BufferedReader文件暂存器、FileViewer文件浏览器、复制文件Copy等方面的操作要领,仅供学习参考。
- 2022-01-26 00:45:09下载
- 积分:1
-
chargepumping
利用charge pumping技术,来测量半导体器件的耐受性及可靠性等相关指标。系统一般包含脉冲源和SMU(源测量仪表)(an skill and measurement method which is using charge pumping to detect characterizaiton of chips )
- 2009-11-03 19:40:51下载
- 积分:1
-
文件 (2)
改变关于一个依赖于时间的解的时间步长的UDF(Change the UDF of a time step for a time-dependent solution)
- 2020-07-02 07:00:01下载
- 积分:1
-
连续写入文件
说明: 比较好的写文件的编程,很有做为编程的参考案例的参考价值。(Better file writing programming, there is a reference value as a reference case of programming.)
- 2020-06-19 23:40:01下载
- 积分:1