solve console wirte \r
support multipul thread