the tee problem
use threads to implement tee