I have written a code which has the following flow:
function parent(){
// fork two process and call the process_callback function
}
function process_callback(){
// poll for id
// process data
// ???????
}
Using PCNTL I am running two simultaneous process which poll and perform some action on the data. The requirement is that, when a process has processed the ID it should die and a new process should start which will again poll and process a new ID.
In the last line ??????
i can call the process_callback()
again (recursion), but wont that increase memory in the system ? Thats why i would prefer letting this process die and creating a new process which agains calls this process_callback