modify write thread

change the calll to runable improve performance.