immutable 不可變對象
thread
conditionally thread
thread
thread
wait & notifyAll
在循環中使用wait 使用notifyAll而不是notify
pipe
java中也有pipe的
/* set up pipes */
PipedOutputStream pout
PipedInputStream pin
PipedOutputStream pout
PipedInputStream pin
/* construct threads */
Producer prod = new Producer(pout
Filter filt = new Filter(pin
Consumer cons = new Consumer(pin
/* start threads */
prod
filt
cons
[
From:http://tw.wingwit.com/Article/program/Java/gj/201311/27705.html