kylewolfe — 2013-02-27T10:26:42-05:00 — #1
Alright, so this ones for my peeps who have experience forking new processes.
I have yet to write a script that does it, but I do get the general idea behind it, how it copies its self etc. My obstacle is that I need a way to either pass a variable or alter something so that I can make each process run something different.
Lets assume I want to create 10 children to run an operation on table. I would like each process to run its operation base don the last digit in the id ( 0-10, 10 processes ). How might one achieve some sort of incrementation to pass to the children so that they are not running on the same term digit, short of using a db table to store and check for who's working on what.
kylewolfe — 2013-02-27T11:09:17-05:00 — #2
Just found this guy: http://www.php.net/manual/en/shmop.examples-basic.php
I'll be sure to let everyone know how it goes and share some sample classes
jestep — 2013-02-27T12:37:54-05:00 — #3
Do you need to know the state or result of the child processes? If not, a blind exec might be a cleaner way to do it and you don't need to wait for the child to finish execution.
kylewolfe — 2013-02-27T13:06:18-05:00 — #4
Absolutely I need to know the state of the child process. That wouldn't be cleaner, it would just be less code