multithreaded stream implemented