Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > How to spawn an idependent child procees on Win32?

Reply
Thread Tools

How to spawn an idependent child procees on Win32?

 
 
Dmitri Kondratiev
Guest
Posts: n/a
 
      09-25-2006
How to create an idependent child procees on Win32 so parent:
1) after spawning child could continue without blocking and not waiting
for child to exit
2) could kill new process
3) get notified when child exits

What is the best way to do this in Ruby? Should I use 'fork'? How parent
can be notified about child exit? Any examples I can look at?

Sorry if I am asking questions belonging to some FAQ, maybe I wasn't
researching this long enough, but I have very little time to find
answers these days

Thanks!
Dima

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
khaines@enigo.com
Guest
Posts: n/a
 
      09-25-2006
On Tue, 26 Sep 2006, Dmitri Kondratiev wrote:

> How to create an idependent child procees on Win32 so parent:


Take a look at Daniel Berger's win32-process library. Find it at:

http://rubyforge.org/projects/win32utils/


Kirk Haines


 
Reply With Quote
 
 
 
 
Nobuyoshi Nakada
Guest
Posts: n/a
 
      09-26-2006
Hi,

At Tue, 26 Sep 2006 06:09:26 +0900,
Dmitri Kondratiev wrote in [ruby-talk:216370]:
> How to create an idependent child procees on Win32 so parent:
> 1) after spawning child could continue without blocking and not waiting
> for child to exit
> 2) could kill new process
> 3) get notified when child exits
>
> What is the best way to do this in Ruby? Should I use 'fork'? How parent
> can be notified about child exit? Any examples I can look at?


$ ./ruby -v -e 'p pid = spawn(%[./ruby -e "sleep 3"]), Time.now; p
Process.wait(pid), Time.now; p $?'
ruby 1.9.0 (2006-09-19) [i386-mingw32]
2360
2006-09-26 15:41:13 +0900
2360
2006-09-26 15:41:16 +0900
#<Process::Status: pid=2360,exited(0)>

--
Nobu Nakada

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Logging stdout/stderr/stdin of an spawn process (Open4::spawn) Edgardo Hames Ruby 1 05-06-2008 08:17 PM
Logging stdout/stderr/stdin of an spawn process (Open4::spawn) Ed Hames Ruby 0 04-16-2008 04:21 PM
spawn syntax + os.P_WAIT mode behavior + spawn stdout redirection Derek Basch Python 2 01-21-2005 05:37 AM
How do I: Main thread spawn child threads, which child processes...control those child processes? Jeff Rodriguez C Programming 23 12-09-2003 11:06 PM



Advertisments