登录
首页 » c++ » 操作系统读者写者实验

操作系统读者写者实验

于 2023-05-14 发布 文件大小:42.77 kB
0 202
下载积分: 2 下载次数: 1

代码说明:

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

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

发表评论

0 个回复

  • drawfunction_for_ppcandpc
    可用于pocket pc 和 pc上的轨迹描绘程序,通过给出坐标描绘出轨迹。并可以进行移动缩放,以及坐标显示等功能。(Can be used for pocket pc and pc on the track of the procedures described by the coordinates given depict the trajectory. And can move the zoom, as well as the coordinates display functions.)
    2007-12-04 13:55:01下载
    积分:1
  • ORGE-WALKING
    ORGE的一个实例代码,演示角色在地图的上面进行走动,源代码(a demo showing a character walking on the ground, powered by ORGE)
    2014-10-26 14:22:41下载
    积分:1
  • 数据结构(c语言)
    数据结构经典教程,对各位编程有帮助!!!(Classic book of data structure, which is helpful to programming)
    2019-05-29 16:04:29下载
    积分:1
  • 三维人脸造型程序
    三维人脸造型程序,vc和opengl实现的,可看到一个旋转的三维人脸模型,可以读取3ds模型文件
    2022-03-25 01:37:18下载
    积分:1
  • This is an instance of a structure. Is mainly used for structured text output.
    这是一个结构实例。主要用于结构文本的输出。-This is an instance of a structure. Is mainly used for structured text output.
    2022-05-05 18:10:05下载
    积分:1
  • 一个简单的个人财务管理系统。 提供给大家免费试用。 希望大家多提意见。...
    一个简单的个人财务管理系统。 提供给大家免费试用。 希望大家多提意见。-a simple personal financial management system. Available to all free trial. We hope to speak up.
    2022-10-07 06:35:03下载
    积分:1
  • WashTransformation
    计算给定序列的沃什(Walsh)变换序列。(Calculation of a given sequence of Vas (Walsh) transform sequence.)
    2008-05-19 15:38:24下载
    积分:1
  • 简单三层代码生成器
     
    2014-11-29下载
    积分:1
  • WorkerThreads
    MCF编程中工作线程的同步
    2022-01-25 18:11:22下载
    积分:1
  • vc调用matlab
    将一个m文件转成c /cpp文件并在VC中进行编译。这种方法有个烦人的地方,每次你都需要把matlab生成的一 大堆c和h文件考到vc中,比如我读入一副图片先做膨胀,再腐蚀,再进行小波变换,最后 显示。这样一个程序会生成大概150多个文件,每次都要拷贝这些文件很不方便。我试着用 了另外一种方法,可以简化这些工作。那就是不生成cpp文件交给VC去编译,而是直接在m atlab中生成一个dll交给VC去链接即可。这样无论matlab生成多少文件,都只需要拷贝三 个文件即可。 (m to a document conversion c/cpp files and compile VC. Such a method is a nagging place every time you need Matlab has generated a lot of c and h vc document examination, for example, I read a photo, first expansion, and corrosion, further wavelet transform, the last show. Such a procedure will probably generate more than 150 documents, each copy of these documents must be very inconvenient. I tried another kind of approach can simplify their work. It is not generating cpp documents to the VC to compile, but m atlab directly in the formation of a dll to the VC to link. No matter how many documents generated Matlab, only three need to copy documents.)
    2005-03-22 21:40:12下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载