Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors

Readers Writes Problem | UGC NET Dec 2018

Q3. UGC NET Dec 2018

To overcome difficulties in Readers-Writers problem, which of the following statement/s is/are true?
1. Writers are given exclusive access to shared objects.
2. Readers are given exclusive access to shared objects.
3. Both Readers and Writers are given exclusive access to shared objects.
Choose the correct answer from the code given below :
Code:
a) 1 only
b) 2 only
c) 3 only
d) Both 2 and 3
Sol. 
What is Readers – Writers problem ?
Ans. Readers Writer Problem is a typical problem of a data resource accessed by two or more processes.
Readers 
  • Never modify database.
  • Same time can be more than one reader.
  • Readers can access database when no writers.
Writers
  • Read and modify database.
  • Same time only one writer.
  • Writers can access database when no readers or writers.
If more than one readers access the shared data simultaneously, no adverse affects will result.
If more than one writer access the shared data simultaneously, chaos may ensue. 
On the basis of this reading we can conclude option (a) is the correct answer.