From: Andreas S Date: 2007-03-01T09:35:30+09:00 Subject: Re: How to check if child process is still alive? >You have to call Process.wait to reap the child process in order for the >child process to disappear entirely. > >Gary Wright > I don't want to use Process.wait because it will block. I have a queue that I want to refill with the next job in line when a slot is available. I'm not gaining much from forking jobs like this but my main purpose is to emulate LSF queue on local machine, in case its down or something. By doing so, the rest of the code still sees a queue. I tried Ara's suggestion, but it doesn't seem to throw exception. Thanks for such prompt response and I love how Ara, even for merely showing example, gave alias alive? alive :) -andre def alive pid pid = Integer("#{ pid }") begin Process::kill 0, pid true rescue Errno::ESRCH false end end c = fork do sleep 5 print "Child exits" exit end while alive c print '.'; STDOUT.flush sleep 1 end >>ruby test.rb ......Child exits......... _________________________________________________________________ Find what you need at prices you�ll love. Compare products and save at MSN� Shopping. http://shopping.msn.com/default/shp/?ptnrid=37,ptnrdata=24102&tcode=T001MSN20A0701