Add basic multithreading support