Ask Question

Solve a single producer, single consumer problem using wait () and notifyAll (). The producer must not overflow the shared buffer, which can happen if the producer is faster than the consumer. If the consumer is faster than the producer, then it must not read the same data more than once. Do not assume anything about the relative speeds (i. e., random producing and consuming speeds) of the producer or consumer.

+2
Answers (1)
  1. 13 June, 01:30
    0
    Basically for producer and consumer problem solving for producer using wait () and notify All ()

    is if synchronization is o then

    {

    while (! IsitTrue ()) {

    o. wait ();

    }

    if o. notify () call appear more than one waiting thread

    then return from the o. wait () makes the condition in false state, than other will go back to waiting.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Solve a single producer, single consumer problem using wait () and notifyAll (). The producer must not overflow the shared buffer, which ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers