ref: extract process_loop
report pid