Trying to use pipes between threads