Re: Process/Thread question

From: Date: Fri, 05 Apr 2002 17:49:48 +0000
Subject: Re: Process/Thread question
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-82143@lists.php.net to get a copy of this message
Hi, > Eric Liedtke <jesus@musinghalfwit.org> > [..] However, I am a little in the dark on what my options > are for spawning off a new process/thread that will continue working in > the background so the exported function can return in the script and go > on it's merry way. I'm hoping a more experienced crowd might have > some suggestions for an implementation of this type. Any pointers to > more info, modules that do something similiar or suggestions would be > very welcome. [..] The most reasonable way of doing this is to write a *seperate* daemon which completes this task. Your PHP script would then connect to this daemon via an interface (sockets). There are "Process Control" Functions http://www.php.net/manual/en/ref.pcntl.php which would allow you to fork a new process, but it is 1. experimental 2. only available for CGI/CLI and not mod_php .. and overall not a good idea. Your script would anyway have to wait for the PINGs to complete - whether it's in a seperate process or not. daniel

« previous php.dev (#82143) next »