文件名称:OS
介绍说明--下载内容均来自于网络,请自行研究使用
在Windows2000环境下,创建一个控制台进程,此进程包含n个线程。用这n个线程来表示n个读者或写者。每个线程按相应测试数据文件(后面介绍)的要求进行读写操作。用信号量机制分别实现读者优先和写者优先问题。
读者-写者问题的读写操作限制(包括读者优先和写者优先)
1) 写-写互斥:不能有两个写者同时进行写操作
2) 读-写互斥:不能同时有一个线程在读,而另一个线程在写。
3) 读-读允许:可以有一个或多个读者在读。
读者优先的附加限制:如果读者申请进行读操作时已有另一个读者正在进行读操作,则该读者可直接开始读操作。
写者优先的附加限制:如果一个读者申请进行读操作时已有另一个写者在等待访问共享资源,则该读者必须等到没有写者处于等待状态后才能开始读操作。
运行结果显示要求:要求在每个线程创建、发出读写申请、开始读写操作和结束读写操作时分别显示一行提示信息,以确定所有处理都遵守相应的读写操作限制。
-In Windows2000 environment, create a console process, this process consists of n threads. N thread n readers or write. Each thread according to the requirements of the corresponding test data files (described later) to read and write operations. Reader priority priority issues and write semaphore mechanism.
Reader- the writer to read and write operating limits (including readers, priority, and the writer takes precedence)
A) write- write mutually exclusive: You can not have two writers write
2) read- write mutually exclusive: You can not have a thread while another thread writing.
3) read- read permission: You can have one or more readers.
Readers priority additional restrictions: If you apply for other readers have read the ongoing read operation, the reader can directly read.
Write priority additional restrictions: If a reader application for the read operation has another write access to shared resources in the waiting, the reader must wait until not write in the wait state to
读者-写者问题的读写操作限制(包括读者优先和写者优先)
1) 写-写互斥:不能有两个写者同时进行写操作
2) 读-写互斥:不能同时有一个线程在读,而另一个线程在写。
3) 读-读允许:可以有一个或多个读者在读。
读者优先的附加限制:如果读者申请进行读操作时已有另一个读者正在进行读操作,则该读者可直接开始读操作。
写者优先的附加限制:如果一个读者申请进行读操作时已有另一个写者在等待访问共享资源,则该读者必须等到没有写者处于等待状态后才能开始读操作。
运行结果显示要求:要求在每个线程创建、发出读写申请、开始读写操作和结束读写操作时分别显示一行提示信息,以确定所有处理都遵守相应的读写操作限制。
-In Windows2000 environment, create a console process, this process consists of n threads. N thread n readers or write. Each thread according to the requirements of the corresponding test data files (described later) to read and write operations. Reader priority priority issues and write semaphore mechanism.
Reader- the writer to read and write operating limits (including readers, priority, and the writer takes precedence)
A) write- write mutually exclusive: You can not have two writers write
2) read- write mutually exclusive: You can not have a thread while another thread writing.
3) read- read permission: You can have one or more readers.
Readers priority additional restrictions: If you apply for other readers have read the ongoing read operation, the reader can directly read.
Write priority additional restrictions: If a reader application for the read operation has another write access to shared resources in the waiting, the reader must wait until not write in the wait state to
(系统自动生成,下载前可以参看下载内容)
下载文件列表
OS课程设计\ceshi.txt
..........\OS 读者写者问题 .doc
..........\zhi.cpp
..........\读者写者问题 3 任务书.doc
OS课程设计
..........\OS 读者写者问题 .doc
..........\zhi.cpp
..........\读者写者问题 3 任务书.doc
OS课程设计