NYCPHP Meetup

NYPHP.org

[nycphp-talk] IPC Problems

csnyder chsnyder at gmail.com
Thu Apr 19 13:38:51 EDT 2007


Hi Ben,

It's been a couple years since I had to deal with forking processes
and such, so I'm not up to debugging your code. But one thing that
might help you simplify is to remember that, at the time of the fork,
the child's environment is the same as the parent's.

If the parent loads the job record from the database into an array or
object named $job, and then forks, the child will have its own copy of
$job and can just go to work on it.

IIRC the database connection is a special case because it's a resource
-- same goes for file pointers. Nevertheless, the child should have
access to the username and password (in $dbSet?) to be able to make
it's own connection to the db.

-- 
Chris Snyder
http://chxo.com/



More information about the talk mailing list