En réponse à :
2 janvier 2023 01:51, par Virgil Maher
In above instance, client comes into image solely when the producer has filled up the queue upto its max measurement. Since both threads have wait conditions they will go there, now you just run it and see what it does, it’ll most likely print the output proven above.
The second confusion comes from the fact that wait must be a call from a synchronized block or technique ?
Why adding item to queue in produce and removing merchandise from queue in devour not in synchronised block (along with the notifies) ? In such instances I can not write such a giant synchronized block , as if (...)