The wait/notify mechanism is essentially used for one thread to "signal" or pass information to another thread. As of Java 5, the new concurrency classes provide more convenient alternatives to many common uses of wait() and notify(). See in particular:
- The CountDownLatch class used to co-ordinate threads;
- The BlockingQueue classes uesd to implement a producer-consumer pattern.
No comments:
Post a Comment