Question

In: Computer Science

one-writer many-readers problem

Explain what is the problem with this implementation of the one-writer many-readers problem?

Explain what is the problem with this implementation of the

Solutions

Expert Solution

The code for the one-writer many readers is fine if we assume that the readers have always priority. The problem is that the readers can starve the writer(s) since they may never all leave the critical region, i.e., there is always at least one reader in the critical region, hence the €˜wrt' semaphore may never be signaled to writers and the writer process does not get access to €˜wrt' semaphore and writes into the critical region.


The code for the one-writer many readers is fine if we assume that the readers have always priority.

Related Solutions

The typical solution of the readers-writers problem works for the following assumptions: (a) Only one writer...
The typical solution of the readers-writers problem works for the following assumptions: (a) Only one writer at a time can access the buffer. Using semaphores, write psuedo code for the following two variations of the reader-writer problem. In each case, provide a short explanation of why there is no deadlock and no starvation in your new code. 1) exactly one writer and one reader exist Writer: Reader: 2) exactly two writers and two readers exist, where writers have priority Writer:...
The typical solution of the readers-writers problem works for the following assumptions: Only one writer at...
The typical solution of the readers-writers problem works for the following assumptions: Only one writer at a time can access the buffer. Write two separate solutions (pseudo code) for the reader and the writer processes in the cases in which 1) exactly one writer and one reader exist 2) exactly two writers and two readers exist, where writers have priority In each case, provide a short explanation of why there is no deadlock and no starvation in your new code.
The typical solution of the readers-writers problem works for the following assumptions: (a) Only one writer...
The typical solution of the readers-writers problem works for the following assumptions: (a) Only one writer at a time can access the buffer. Write two separate solutions (pseudo code) for the reader and the writer processes in the cases in which 1) exactly one writer and one reader exist 2) exactly two writers and two readers exist Note: writers have priority In each case. Also, provide a short explanation (about 2 lines) of why there is no deadlock and no...
In argumentative writing, the writer strives to get across a specific perspective and hopefully convince readers...
In argumentative writing, the writer strives to get across a specific perspective and hopefully convince readers to agree with that viewpoint. What type of evidence do you feel will best convince readers to agree with the stance you have taken on your topic?
In the 2016 presidential election, many polls were made available to readers on a daily basis....
In the 2016 presidential election, many polls were made available to readers on a daily basis. Of course, each of these polls reported a margin of error that was associated with the results. What is a margin of error, what does it tell us, and why is the margin of error reported? Is the margin of error truly necessary to calculate? Why or why not?
Many animals are in danger of extinction. One way to see the extent of the problem...
Many animals are in danger of extinction. One way to see the extent of the problem is to study the numbers of animals on the endangered species list. The following data show the numbers of endangered species for various groups of animals. The count is the total number of endangered species within the group. Thus, there are 37 mammals on the endangered species list within the United States and 249 others in the rest of the world. Group United States...
Although Aeneas is an archetypal Roman hero, many modern readers do not find his treatment of...
Although Aeneas is an archetypal Roman hero, many modern readers do not find his treatment of Dido heroic. Explain your thoughts on whether or not you believe that Aeneas's behavior toward Dido was heroic. How does your worldview influence your judgment of Aeneas?
chp 33 One of the many items mentioned in the last presidential campaign was the problem...
chp 33 One of the many items mentioned in the last presidential campaign was the problem of outsourcing jobs overseas. President-elect Trump vowed to raise and impose tariffs on imported goods in an effort to bring jobs back to the United States. Discuss here this strategy and whether or not this can be successful and the possible consequences if there are any. Support your argument and, as always, respond to at least two other postings.
Many readers finish the article without realizing that "Nacirema" is "American" spelled backwards. Why did Miner...
Many readers finish the article without realizing that "Nacirema" is "American" spelled backwards. Why did Miner write about Americans as if we were a strange tribe? What insights do we gain about ourselves by taking this perspective?
Which one of the following business strategies, used by Direct Writer insurers, involves an organization selling...
Which one of the following business strategies, used by Direct Writer insurers, involves an organization selling its product directly to the customer rather than through a wholesaler or other intermediary? Select one: a. Multi-divisional structure b. Differentiation c. Cost leadership d. Vertical integration
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT