Fork threads and wait for their result