-
读者写者问题
说明: 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
-
BlindDeconvolution
说明: 对声呐接收到的信号进行解卷积,还原原始信号
仿真条件:假设有三条传播路径,海底反射、海面反射、直达波(The signal received by sonar is deconvoluted to restore its original signal.
Simulation conditions: it is assumed that there are three propagation paths, bottom reflection, sea surface reflection and direct wave)
- 2020-11-06 19:29:49下载
- 积分:1
-
客流统计系统源程序, 客流统计系统源程序
客流统计系统源程序, 客流统计系统源程序-Passenger statistics system source code
- 2022-12-11 19:25:03下载
- 积分:1
-
FDA
画出频控阵和相控阵天线方向图,只要进行0和1输入,便可以选择相应的天线方向图(Drawing frequency diverse array and phased array antenna pattern)
- 2018-01-13 19:19:36下载
- 积分:1
-
keilc51写的,双色LED点阵屏 可移动 速度可调
keilc51写的,双色LED点阵屏 可移动 速度可调-keilc51 written, two-color LED Display Screen Mobile adjustable speed
- 2022-03-22 06:22:07下载
- 积分:1
-
LORZEN
实现混沌序列的产生于归一化,提供混沌时间序列预测的初始数据(The realization of the normalization of chaotic sequence)
- 2018-05-12 15:24:14下载
- 积分:1
-
diveintopythonzh-cn-5.4b-code
python工具书查询,之前看到的,资料还不错,可以参考学习下(Reference books for python)
- 2020-06-18 07:40:02下载
- 积分:1
-
MCTK-2.1.10
说明: MODIS Conversion Toolkit 可以进行MODIS 数据转换和提取(American Conversion Toolkit)
- 2020-06-16 00:20:01下载
- 积分:1
-
flash game series and is a useful Dongdong, hope to be able to help everyone
flash编的游戏是一个和好用的东东,希望能够帮助大家-flash game series and is a useful Dongdong, hope to be able to help everyone
- 2022-05-27 10:41:29下载
- 积分:1
-
REST-API-SENSOR
说明: Simple code to create a Restful API with flask.
- 2021-01-19 10:28:42下载
- 积分:1