登录
首页 » c++ » 用信号量来实现读者-写者问题

用信号量来实现读者-写者问题

于 2022-03-18 发布 文件大小:1.83 kB
0 207
下载积分: 2 下载次数: 1

代码说明:

在Windows2000或Windows XP环境下,创建一个控制台进程,此进程包含n个线程。用这n个线程来表示n个读者或写者。每个线程按相应测试数据文件的要求进行读写操作。用信号量机制分别实现读者优先和写者优先问题。 读者-写者问题的读写操作限制(包括读者优先和写者优先) 1)  写-写互斥:不能有两个写者同时进行写操作 2)  读-写互斥:不能同时有一个线程在读,而另一个线程在写。 3)  读-读允许:可以有一个或多个读者在读。 读者优先的附加限制:如果读者申请进行读操作时已有另一个读者正在进行读操作,则该读者可直接开始读操作。 写者优先的附加限制:如果一个读者申请进行读操作时已有另一个写者在等待访问共享资源,则该读者必须等到没有写者处

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • CSharp write with a videocamera test procedure. Support most of the USB camera....
    用CSharp写的一个VideoCamera测试程序。支持市面上大多数USB摄像头。可以抓图和录像。不过功能不是很完善。-CSharp write with a videocamera test procedure. Support most of the USB camera. Can capture and video. But function is not very perfect.
    2022-03-20 12:28:18下载
    积分:1
  • app1(1)
    计算结构振动,在人行桥上人走动产生的行走作用力,进而进行振动控制(Vibration control is carried out by calculating the structural vibration and the walking force produced by walking on the pedestrian bridge.)
    2019-03-04 15:13:44下载
    积分:1
  • aw9136驱动代码
    aw9136驱动程序实现,包括硬件gpio配置,模拟I2C通信借口的实现,输入键值上报,中断处理等./************************************************************************** *  AW9136_ts_3button.c *  *  Create Date : *  *  Modify Date :  * *  Create by   : AWINIC Technology CO., LTD * *  Version     : 1.0 , 2014/06/27 *                2.0 , 2014/06/27 *                2.1 , 2014/07/01 *                2.2 , 2014/07/02 *  **************************************************************************/ ////////////////////////////////////////////////////////////// //   //  APPLICATION DEFINE : // //                   Mobile -    MENU      HOME   &nb
    2023-03-23 20:40:04下载
    积分:1
  • wdyl_3
    实现温度压力试验平台的测量的VC++程序,需要一些工业控件和皮肤控件,要在网上自行下载(Achieve the measurement of temperature and pressure test platform of VC++ program, need to control a number of industrial controls and the skin to the Internet to download)
    2011-06-28 21:30:07下载
    积分:1
  • TEST11
    件设计思路是利用 MS 的定时器 B 中断执行相应的中断服务程序来产生舵机用多 路 PWM 波.4的 系 统 主 时 钟 频 率 取 8 MHz,设每个定时周期取 250/ =31.25 μs,(The x medium-density performance line family incorporates the highperforfrequency, highspeed embedded memories (Flash memory up toytes), and an extensive range of s and peripherals connected to two APB buses.)
    2019-05-09 22:49:55下载
    积分:1
  • 012、UART串口发送十六进制控制继电器开关
    stc15f104 UART串口发送十六进制控制继电器开关(Stc15f104 UART serial port sends sixteen control relay switch)
    2018-03-16 23:25:17下载
    积分:1
  • 5DAC
    c8051F040 单片机 DAC调试程序(c8051F040 microcontroller DAC Debugger)
    2010-06-02 17:00:19下载
    积分:1
  • alertView
    UIAlertView 你应该对它都是再熟悉不过的了,但是在iOS8 里已经过期了,用来取代它的是UIAlertController-展示action sheet和modal alert。下面用swift带着你从UIAlertView转变到UIAlertController:UIAlertVie
    2023-08-15 09:25:03下载
    积分:1
  • stringmatch
    说明:  高速多字符串匹配程序,基于多字符串的KMP算法开发,能够实现多字符串的匹配(High-speed multi-string matching procedure, based on multi-string KMP algorithm development, to achieve multi-string match)
    2009-07-22 10:36:52下载
    积分:1
  • Para.-Est.-and-Inv.-Problems
    这是一本关于地球物理反演方法的经典著作《Parameter Estimation and Inverse Problems》,学地球物理的可以看看。(this book is for geophysics inverse problem base study. worth reading if you are a student of geophysics.)
    2013-08-28 11:21:33下载
    积分:1
  • 696518资源总数
  • 105901会员总数
  • 40今日下载