Naive multi-threaded pipeline implementation.