Using semaphore to realize reader writer problem
2017-12-16
0 0 0
no vote
Other
Earn points
In Windows 2000 or Windows XP environment, create a console process, this process contains n threads. Use these n threads to represent n readers or writers. Each thread reads and writes according to the requirements of the corresponding test data file. The semaphore mechanism is used to realize reader priority and writer priority respectively. Read write constraints of reader writer problem (including reader first and writer first) 1) & nbsp; write write mutex: two writers cannot write at the same time 2) & nbsp; read write mutex: one thread cannot read and another thread cannot write at the same time. 3) Read read allow: one or more readers can be reading. Additional restriction of reader priority: if another reader is in the process of reading when applying for reading operation, the reader can directly start reading operation. Additional restriction of writer first: if a reader has another writer waiting to access the shared resource when applying for reading, the reader must wait until there is no writer
Related Source Codes
Android AOA Android Open Accessory Development Usi
0
0
no vote
Golang AOA Android Open Accessory HID Control
0
0
no vote
PClite
0
0
no vote
GMSK Linear Receiver
0
0
no vote
The golden version of AFT that has been passed dow
0
0
no vote
No comment