文件名称:Reader-Writer
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:7.34kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
创建一个控制台进程,此进程包含n个线程,用这n个线程来表示n个读者或写者,每个线程按相应测试数据文件(后面有介绍)的要求进行读写操作,用信号量机制分别实现读者优先和写者优先的读者-写者问题。
读者-写者问题的读写操作限制(包括读者优先和写者优先):
写-写互斥,即不能有两个写者同时进行写操作。
读-写互斥,即不能同时有一个线程在读,而另一个线程在写。
读-读允许,即可以有一个或多个读者在读。
读者优先的附加限制:如果一个读者申请进行读操作时已有另一个读者正在进行读操作,则该读者可直接开始读操作。
写者优先的附加限制:如果一个读者申请进行读操作时已有另一写者在等待访问共享资源,则该读者必须等到没有写者处于等待状态后才能开始读操作。-Create a console process, this process contains n threads, n-reader or writer to represent with n threads, each thread according to the corresponding test data files (followed by descr iption) the requirements of the read and write operations, semaphores mechanisms, respectively reader priority and the write priority reader- writer problem. Reader- the writer to read and write operating limits (including the reader priority and priority to the writer): write- write mutually exclusive, ie can not have two writers write. Read- write mutex that is not at the same time there is a thread in another thread writing. Read- read permission, which can have one or more readers. Readers priority additional restrictions: If a reader application for the read operation has been another reader being read, the reader can directly read. Write priority additional restrictions: If a reader application for the read operation has been another writer in waiting for access to shared resources, the reader must
读者-写者问题的读写操作限制(包括读者优先和写者优先):
写-写互斥,即不能有两个写者同时进行写操作。
读-写互斥,即不能同时有一个线程在读,而另一个线程在写。
读-读允许,即可以有一个或多个读者在读。
读者优先的附加限制:如果一个读者申请进行读操作时已有另一个读者正在进行读操作,则该读者可直接开始读操作。
写者优先的附加限制:如果一个读者申请进行读操作时已有另一写者在等待访问共享资源,则该读者必须等到没有写者处于等待状态后才能开始读操作。-Create a console process, this process contains n threads, n-reader or writer to represent with n threads, each thread according to the corresponding test data files (followed by descr iption) the requirements of the read and write operations, semaphores mechanisms, respectively reader priority and the write priority reader- writer problem. Reader- the writer to read and write operating limits (including the reader priority and priority to the writer): write- write mutually exclusive, ie can not have two writers write. Read- write mutex that is not at the same time there is a thread in another thread writing. Read- read permission, which can have one or more readers. Readers priority additional restrictions: If a reader application for the read operation has been another reader being read, the reader can directly read. Write priority additional restrictions: If a reader application for the read operation has been another writer in waiting for access to shared resources, the reader must
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Reader-Writer.doc
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.