do_heatbeat: master thread