CodeBus
www.codebus.net
Search
Sign in
Sign up
Hot Search :
Source
embeded
web
remote control
p2p
game
More...
Location :
Home
Search - mutual exclusion
Main Category
SourceCode
Documents
Books
WEB Code
Develop Tools
Other resource
Search - mutual exclusion - List
[
Software Engineering
]
readerwriter
DL : 0
实验一 用信号量来实现读者-写者问题 (一) 实验目的 理解进程(或线程)及信号量的概念 (二) 实验内容 1、定义一个数据缓存buffer及用于实现同步互斥的信号量。 2、定义一个读者函数: 当有写者在占用buffer时,读者应该等待,直到写者不再使用该buffer。 当有其他读者在占用buffer时,读者可对buffer进行读取操作。 当buffer中有数据时,则从其中读取一个数据,并显示然后退出。 当buffer中没有数据时,应等待,直到buffer中有数据可读。 3、定义一个写者函数 当有读者在占用buffer时,写者应该等待,直到所有的读者都退出为止。 当有其他写者占用buffer时,该写者应该等待,直到占用buffer的写者退出为止。 当buffer有空闲时,写者应该在buffer中写入一个数据并退出。 当buffer满时,写者应该等待,直到buffer有空闲为止。 4、定义主函数,在其中可以任意创建读者与写者。 可根据用户输入创建读者或写者进程(线程)。 5、用户界面 (三) 实验要求 在实验过程中,显示详细的各进程(线程)的状态及buffer使用情况。 (四) 实验学时 3-Experiments using semaphore to implement a reader- writer problem (A) purpose of the experiment Understand the process (or thread), and the concept of semaphore (b) of the experiment content 1, define a data cache buffer, and synchronization for mutual exclusion semaphore. 2, the definition of a reader function: When a write buffer in the occupation, the reader should wait until the writer is no longer used in the buffer. When there are other readers in the occupied buffer, the reader can read buffer operations. When the buffer has data, from which a data read and displayed and then exit. When the buffer contains no data, they should wait until the buffer has data to read. 3, define the function of a writer When a reader occupied buffer, the writer should wait until all of the readers exit. When the buffer occupied by other writers, the writer should wait until the write buffer occupied by exit. When the buffer in their free time to write should be written in a
Date
: 2025-12-19
Size
: 120kb
User
:
镡皓琳
[
Software Engineering
]
Operating-systems-curriculum-design
DL : 0
利用模拟用信号量机制实现读者和写者问题:通过用户控制读进程和写进程,反应读者和写者问题中所涉及的进程的同步与互斥。-Using simulated using semaphore mechanisms readers and writers problem: by the user to control the reading process and the writing process, the reaction synchronization and mutual exclusion problem readers and writers involved in the process.
Date
: 2025-12-19
Size
: 133kb
User
:
zhao
[
Software Engineering
]
os
DL : 0
操作系统实验报告进程同步与互斥方面的报告-The report of the experiment report operating system process synchronization and mutual exclusion terms
Date
: 2025-12-19
Size
: 232kb
User
:
郑悦
CodeBus
is one of the largest source code repositories on the Internet!
Contact us :
1999-2046
CodeBus
All Rights Reserved.