in reply to fork() and defunct children
As a general point, why are you trying to have multiple processes write to the DB? Do you think it will be faster? I suspect that since this will be most likely disk bound (aside from the cost of building an index, which can be done after all updates are performed), having multiple processes go at this won't gain you much. maybe its ok to get rid of the confusing and have a single process do it. Otherwise, you can try writing the parts that would be forked in another script, then doing a system(" otherScript.pl $data &")
then your main script will continue while the other script does it's thing.
Re^2: fork() and defunct children
by Anonymous Monk on Feb 12, 2008 at 22:53 UTC
|
Not write to -- read from. It won't be faster, but the children will mostly be shelling out system commands, and occasionally doing something like SHOW CREATE TABLE to the database. So the DB accesses will be few and short, while the children mostly spend time waiting for system() calls to finish. | [reply] |
|