Re: [PHP] process creation

2009-01-23 Thread Per Jessen
bruce wrote:

> A simple question (or so I thought).
> 
> Does php allow an app to create/start a process/application that can
> continue to run on its own, after the initiating program/app
> terminates?

Generally yes, but it's partially up to the spawned process to
completely detach itself.

> It appears that the spawning/forking functions might work, but the
> child apps would be in a zombie status, and couldn't be killed by an
> external program.

I'm not sure, but I think there's something wrong if you can't kill them
with a -9. 

> Basically, I'd like to create a bunch of test apps/processes, and then
> to be able to kill them by a separate process if the apps take too
> long to run..

Why not put a timer in each individual process?


/Per Jessen, Zürich


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



RE: [PHP] process creation

2009-01-23 Thread bruce
Hi Török.

My test code had/has something similar.. but it kept displaying zombie 
processes as well as legitimate processes in the ps tbl/display...

Turns out I had a mistake in the test "client" ap/process that I was 
creating... This was causing the child process to die, resulting in a "zombie" 
process, until the parent got around to doing a waitpid call...

i think it's ok now...

thanks

ps, torok... are you in the US/Canada? Also, are you up to talking to me about 
this project that I'm playing with?



-Original Message-
From: Török Alpár [mailto:torokal...@gmail.com]
Sent: Friday, January 23, 2009 10:09 AM
To: bruce
Cc: php-general@lists.php.net
Subject: Re: [PHP] process creation


2009/1/23 bruce 

> A simple question (or so I thought).
>
> Does php allow an app to create/start a process/application that can
> continue to run on its own, after the initiating program/app terminates?
>
> It appears that the spawning/forking functions might work, but the child
> apps would be in a zombie status, and couldn't be killed by an external
> program.
>
> Basically, I'd like to create a bunch of test apps/processes, and then to
> be
> able to kill them by a separate process if the apps take too long to run..

  You can have the  parent sleep, and then clean up like :

$aPids = array();
for ($i=0;$i
> So.. thoughts/comments would be appreciated!
>
> thanks
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Torok, Alpar Istvan


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



Re: [PHP] process creation

2009-01-23 Thread Török Alpár
2009/1/23 bruce 

> A simple question (or so I thought).
>
> Does php allow an app to create/start a process/application that can
> continue to run on its own, after the initiating program/app terminates?
>
> It appears that the spawning/forking functions might work, but the child
> apps would be in a zombie status, and couldn't be killed by an external
> program.
>
> Basically, I'd like to create a bunch of test apps/processes, and then to
> be
> able to kill them by a separate process if the apps take too long to run..

  You can have the  parent sleep, and then clean up like :

$aPids = array();
for ($i=0;$i
> So.. thoughts/comments would be appreciated!
>
> thanks
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Torok, Alpar Istvan


Re: [PHP] process creation

2009-01-23 Thread Alexandre Gaigalas
On Fri, Jan 23, 2009 at 3:47 PM, bruce  wrote:

> A simple question (or so I thought).
>
> Does php allow an app to create/start a process/application that can
> continue to run on its own, after the initiating program/app terminates?
>
> It appears that the spawning/forking functions might work, but the child
> apps would be in a zombie status, and couldn't be killed by an external
> program.
>
> Basically, I'd like to create a bunch of test apps/processes, and then to
> be
> able to kill them by a separate process if the apps take too long to run..
>
> So.. thoughts/comments would be appreciated!
>
> thanks
>
>
>
Check out the user comments under this function:

http://php.net/ignore_user_abort


--
Alexandre Gomes Gaigalas
alexan...@gaigalas.net
http://Alexandre.Gaigalas.Net


[PHP] process creation

2009-01-23 Thread bruce
A simple question (or so I thought).

Does php allow an app to create/start a process/application that can
continue to run on its own, after the initiating program/app terminates?

It appears that the spawning/forking functions might work, but the child
apps would be in a zombie status, and couldn't be killed by an external
program.

Basically, I'd like to create a bunch of test apps/processes, and then to be
able to kill them by a separate process if the apps take too long to run..

So.. thoughts/comments would be appreciated!

thanks



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