PHP CLI Forking Problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
   We've got a script setup that forks a number of child processes,
using pcntl_fork. When a child finishes we capture the SIGCHLD, do
pcntl_wait, and then fork of another child. This has worked fine in one
script but now using exactly the same forking code in another script has
resulted in problems.
   Now it seems, the child will get to the exit but the exit function
will not actually complete. I'm not sure what's likely to be causing
this, I was wondering if the child was waiting for the parent to finish
with resources perhaps? But the other forking script has similar
resources setup too. I tried stracing the running child process and got
nothing out. I tried gdb on the running process and got the following:
                        q = p;
(gdb)
554                     p = p->pListNext;
(gdb)
555                     if (ht->pDestructor) {
(gdb)
556                             ht->pDestructor(q->pData);
(gdb)
558                     if (!q->pDataPtr && q->pData) {
(gdb)
561                     pefree(q, ht->persistent);
(gdb)
555                     if (ht->pDestructor) {

Basically it's looping on those commands over and over... Now I think
about it that could just be it freeing up each individual allocated bit
of memory, but I've left it running for ten minutes and the children
still didn't manage to finish. Anyone got any thoughts?
Thanks,
John McKerrell

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux