
"Hi, Amigo!"
16
Task
Java Multithreading, level 7, lesson 9
Producer–consumer
In the TransferObject class, arrange calls to the wait/notify/notifyAll methods
to ensure the sequential production and consumption of objects.
In the run methods of the ConsumerTask and ProducerTask classes, create the necessary synchronized blocks.
16
Task
Java Multithreading, level 7, lesson 9
Arrange wait and notify methods
Arrange wait and notify methods.
Example output:
Thread-0 MailServer received: [Person [Thread-1] wrote an email 'AAA'] in 1001 ms.
16
Task
Java Multithreading, level 7, lesson 9
CountDownLatch
You are given a standard implementation of the wait-notify pattern.
Read about CountDownLatch and use the latch field to rewrite the body of the someMethod method.
Remove all unnecessary code from the class.