Use a dedicated dispatch queue for tmux threadedReadTask:length: calls. Previously I used dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) which actualy creates a queue every time, causing a race condition and mixed up streams.