seaver has asked for the wisdom of the Perl Monks concerning the following question:
Following a recent thread, I managed to put together a daemon that works, in the sense that it returns '0' while running an external process using 'exec()'
$SIG{CHLD}=sub { wait(); print "Child exited\n";}; $| = 1; exec("/usr/local/bin/monster", "-i$id", "$filePath$file") unless fork( +); return 0;
The only thing is, if I try to start ANOTHER run at the same time, before the first EXTERNAL process has finished, the 'run' button hangs UNTIL the first process has finished and the CHLD handler returns, and then it runs it. It's basically queuing requests.
Each request is made from an applet i designed that uses XML-RPC, and the daemon is in turn a SOAP::Lite XML-RPC daemon. I need to use this daemon to work as an application server, in the true sense of a server, so that it will be able to accept any request at any time, and immediately run the software.
bottom line is that the above code doesnt do this job, what should i do to make sure that it'll immediately run every request.
thanks
Sam
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: It works, and then it doesn't...connecting to a daemon over the net
by Thelonius (Priest) on Jun 12, 2003 at 20:43 UTC | |
by seaver (Pilgrim) on Jun 12, 2003 at 21:23 UTC | |
by seaver (Pilgrim) on Jun 18, 2003 at 17:07 UTC | |
|
Re: It works, and then it doesn't...connecting to a daemon over the net
by Thelonius (Priest) on Jun 12, 2003 at 21:56 UTC | |
by seaver (Pilgrim) on Jun 13, 2003 at 18:56 UTC | |
|
Re: It works, and then it doesn't...connecting to a daemon over the net
by Thelonius (Priest) on Jun 19, 2003 at 02:55 UTC | |
|
Re: It works, and then it doesn't...connecting to a daemon over the net
by seaver (Pilgrim) on Jun 12, 2003 at 20:01 UTC |