homework_5 Version 0 |
|
👤 Author: by 522145329qqcom 2017-10-29 10:58:13 |
How many type of reader and writer problems? use semaphores to solve these problems , and explain them in detail.
answer:
There are at least three variations of the readers-writers problems.
1、
The first readers-writers problem, in which the constraint is added that no reader shall be kept waiting if the share is currently opened for reading.
A solution:
semaphore resource=1;
semaphore rmutex=1;
r