transform check_parent_pid into a generic function to delay work.
regenerate random page every 100 iterations of the child loop