例子
Java · 3 notes
- 6.30 Producer-Consumerhistorical
1. Using BlockingQueue. 2. Using wait/notify. 3. Using Lock/Condition. Compared with wait/notify, two Conditions are used so producers and consumers are not woken together; each side wakes only the other side.
- Multithreaded Folder Size Statisticshistorical
Start three threads to calculate separately; use the final thread to aggregate the result.