CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced:
waitpid and fork

 



kazerm
New User

Jul 8, 2009, 10:52 PM

Post #1 of 2 (1884 views)
waitpid and fork Can't Post

Hi,

can I wait for process ID that was open in another script?

I'm running script A that open script B

Script B runs fork (on windows) and the father return to script A (on windows), can I save the child $pid in a file, read it from script A and wait for it in script A?

If not, is there a way to communicate between two different scripts? How can one script can tell if the other has finished?

By the way, is it possible that the $pid is negative number? print of $pid gives -4588 (the script runs on windows server)

Thanks

(This post was edited by kazerm on Jul 8, 2009, 11:14 PM)


shawnhcorey
Enthusiast


Jul 9, 2009, 5:53 AM

Post #2 of 2 (1879 views)
Re: [kazerm] waitpid and fork [In reply to] Can't Post


In Reply To
Hi,

can I wait for process ID that was open in another script?

I'm running script A that open script B

Script B runs fork (on windows) and the father return to script A (on windows), can I save the child $pid in a file, read it from script A and wait for it in script A?

If not, is there a way to communicate between two different scripts? How can one script can tell if the other has finished?

By the way, is it possible that the $pid is negative number? print of $pid gives -4588 (the script runs on windows server)

Thanks


Two programs can communicate with each other via InterProcess Communication (IPC). See `perldoc perlipc` for details.

On Windows, fork doesn't do a true fork; instead it starts a thread.

And you're right, no PID should be negative.

__END__

I love Perl; it's the only language where you can bless your thingy.

Perl documentation is available at perldoc.perl.org. The list of standard modules and pragmatics is available in perlmodlib.

Get Markup Help. Please note the markup tag of "code".

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives