Using threading instead of multiprocessing