move old code about muti-thread