transform multi-thread to multiprocess