in reply to Threads/processes under Apache

...there are several fork/exec pairs. ... Is there anything I should be wary of?

Yes.

Forks on Win32 are emulated as threads, and to date the implementation is a bit unreliable. I'd suggest looking into using Win32::Process as an alternative.

Or possibly using Win32::Daemon, if your architecture is going to need the shakeup I think it will (As previously pointed out wrt Apache, your architecture will need some serious tweaking to do what you're attempting)


Perl Contrarian & SQL fanboy

Replies are listed 'Best First'.
Re^2: Threads/processes under Apache
by pmcaveman (Novice) on Dec 02, 2006 at 01:57 UTC
    I was really hoping to get something functional using threads and function calls into the server. If it is standalone, then my scripts will need some hokey magic with message queues or some such interface. That is actually the current interface - a standalone server written in C waiting to accept udp messages, and when one is accepted, just do a system call with the contents of the message to launch a new browser with an argument of a new cgi script. Any way I can simplify the situation would be the best-case. The perl cgi scripts are driving the project, as they serve up html to a browser, and sockets from the main system need to interface and control things (both coming and going).

      If it is standalone, then my scripts will need some hokey magic with message queues or some such interface.

      Why would it need that? Can you explain a little more about what this UDP server is supposed to be doing? I can't understand why you think it would be simpler to have a CGI script become a server.

      That is actually the current interface - a standalone server written in C waiting to accept udp messages, and when one is accepted, just do a system call with the contents of the message to launch a new browser with an argument of a new cgi script.

      There's no reason to use a system call to make an HTTP request. Just use something like LWP if that's what you need to do.