16
任务
Java Multithreading, 第 7 级, 课程 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
任务
Java Multithreading, 第 7 级, 课程 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
任务
Java Multithreading, 第 7 级, 课程 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.