操作系统读者写者问题源程序

上传者: sl198811 | 上传时间: 2023-04-26 16:59:51 | 文件大小: 1.33MB | 文件类型: RAR
#include #include #include "fstream.h" //全局变量 int readcount=0; //读者数目 int writecount=0; //写者数目 /* 关键代码段是指一个小代码段,在代码能够执行前,它必须独占对某些共享资源的访问权。 这是让若干行代码能够“以原子操作方式”来使用资源的一种方法。 */ CRITICAL_SECTION RP_Write; //临界区 CRITICAL_SECTION cs_Write; CRITICAL_SECTION cs_Read; struct ThreadInfo //线程信息 { int Threadhao; //线程序号 char ThreadClass; //线程类别 double ThreadStartTime; //线程开始时间 double ThreadRunTime; //线程读写持续时间 }; void ReaderFun(char* file);//读者优先函数 void R_ReaderThread(void *p);//处理读者优先读者线程 void R_WriterThread(void *p);//处理读者优先写者线程 void WriterFun(char* file); void W_ReaderThread(void *p); void W_WriterThread(void * 这个程序可以供大家参考,完全可以正确运行,得到自己想要的结果。

文件下载

资源详情

[{"title":"( 21 个子文件 1.33MB ) 操作系统读者写者问题源程序","children":[{"title":"读者写者问题源码程序","children":[{"title":"peizhi.txt <span style='color:#111;'> 49B </span>","children":null,"spread":false},{"title":"ReaderWriter.exe <span style='color:#111;'> 248.07KB </span>","children":null,"spread":false},{"title":"VCReaderWriter","children":[{"title":"RW.CPP <span style='color:#111;'> 10.16KB </span>","children":null,"spread":false},{"title":"ReaderWriter.opt <span style='color:#111;'> 47.50KB </span>","children":null,"spread":false},{"title":"ReaderWriter.ncb <span style='color:#111;'> 41.00KB </span>","children":null,"spread":false},{"title":"ReaderWriter.dsw <span style='color:#111;'> 530B </span>","children":null,"spread":false},{"title":"ReaderWriter.plg <span style='color:#111;'> 909B </span>","children":null,"spread":false},{"title":"ReaderWriter.sln <span style='color:#111;'> 913B </span>","children":null,"spread":false},{"title":"czh.txt <span style='color:#111;'> 10.15KB </span>","children":null,"spread":false},{"title":"peizhi.txt <span style='color:#111;'> 49B </span>","children":null,"spread":false},{"title":"ReaderWriter.suo <span style='color:#111;'> 8.50KB </span>","children":null,"spread":false},{"title":"ReaderWriter.vcproj <span style='color:#111;'> 4.22KB </span>","children":null,"spread":false},{"title":"ReaderWriter.dsp <span style='color:#111;'> 4.24KB </span>","children":null,"spread":false},{"title":"ReaderWriter.exe <span style='color:#111;'> 248.07KB </span>","children":null,"spread":false},{"title":"Debug","children":[{"title":"RW.obj <span style='color:#111;'> 34.31KB </span>","children":null,"spread":false},{"title":"vc60.idb <span style='color:#111;'> 145.00KB </span>","children":null,"spread":false},{"title":"ReaderWriter.pdb <span style='color:#111;'> 625.00KB </span>","children":null,"spread":false},{"title":"vc60.pdb <span style='color:#111;'> 92.00KB </span>","children":null,"spread":false},{"title":"ReaderWriter.exe <span style='color:#111;'> 248.13KB </span>","children":null,"spread":false},{"title":"ReaderWriter.ilk <span style='color:#111;'> 317.14KB </span>","children":null,"spread":false},{"title":"ReaderWriter.pch <span style='color:#111;'> 3.46MB </span>","children":null,"spread":false}],"spread":false}],"spread":false}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明