recategorized by
2,747 views
2 votes
2 votes

​​​​​​​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:$

  1. (i) only
  2. (ii) only
  3. (iii) only
  4. Both (ii) and (iii)
recategorized by

2 Answers

1 votes
1 votes

In Reader-Writers problem, multiple readers can access at the same time, but when a writer is using a resource there should be no interference. So, writer is given exclusive access to shared resource.

So, $(A)$ should be the answer

0 votes
0 votes

Option A is correct

Understand the concept

Process 1 | Process 2nt  | Allowed/Not Allowed

Writer | Writer | Not allowed

Writer | Reader | Not allowed

Reader | Reader | Allowed

Reader | Writer | Not allowed

Here, in other words, multiple readers can access shared variable and even they count “How many readers are currently executing concurrently”. But it is necessary that whenever writer comes no reader should be present. Therefore we can Say Readers are given shared objects but writers are given exclusive access to shared objects.

 

Related questions

0 votes
0 votes
6 answers
1
Arjun asked Jan 2, 2019
3,046 views
Consider a disk pack with $32$ surfaces, $64$ tracks and $512$ sectors per pack. $256$ bytes of data are stored in a bit serial manner in a sector. The number of bits req...
1 votes
1 votes
2 answers
4