Iterate through PIDs using function pointers