You can pass "is_pid_alive" the pid and it returns a boolean.