
fashimpaur
User
/ Moderator
Aug 20, 2002, 8:12 AM
Views: 3294
|
Spawning Child Process in Multiple Environments
|
|
|
I have a web based application that does some extensive searches and data manipulation that can take a long time to process. Most web servers timeout if I try to complete the whole process in one chunk. What I would like to do is pass the search criteria to the CGI program from the web based form and then do the following: If the process is simple (single record search or changing user preferences only) The application will change the preferences or start search program that creates a results file for the single record search. The search program will be the same program that is used for multiple record searches. The main program will sleep for 10 seconds to allow the time for a single record search to complete. If the file is created in that ten seconds, the main program will immediately post the results. Otherwise, the main program will display a 'Search in Progress' message and recall the main program after 6 seconds. If the file is done, It will display the results. Otherwise, the process repeats until the file is done or more than $x number of minutes have elapsed. If $x minutes is passed, an message will be displayed to contact the system admin to check for errors. If the process is an intensive search The application will behave exactly as above, but will never have the processing complete after the initial 10 second sleep. The problem is this. If I use exec() or system() to call the program that will do the search, the main application still waits to display output until the called child process completes. What I need is complete disassociation of the called process. I need to start the search from the main program and display whatever output is required without waiting for that search to complete. Does anyone have an idea how to do this? I really need help getting this done. I have to demo this program to it's users tomorrow afternoon. Any assistance or contribution of ideas would be greatly appreciated. Please post any suggestions that you think could viably solve the problem, no matter how far fetched you think they may be. I am DESPERATE!!!!! Thanks In Advance, Dennis $a="c323745335d3221214b364d545". "a362532582521254c3640504c3729". "2f493759214b3635554c3040606a0", print unpack"u*",pack "h*",$a,"\n\n";
(This post was edited by fashimpaur on Aug 20, 2002, 8:14 AM)
|