[#4567] Re: What's the biggest Ruby development? — Aleksi Niemel<aleksi.niemela@...>

Dave said:

18 messages 2000/08/23
[#4568] Q's on Marshal — Robert Feldt <feldt@...> 2000/08/23

[#4580] RubyUnit testcase run for different init params? — Robert Feldt <feldt@...> 2000/08/25

[#4584] Re: RubyUnit testcase run for different init params? — Dave Thomas <Dave@...> 2000/08/25

Robert Feldt <feldt@ce.chalmers.se> writes:

[#4623] Re: RubyUnit testcase run for different init params? — Robert Feldt <feldt@...> 2000/08/28

On Sat, 26 Aug 2000, Dave Thomas wrote:

[#4652] Andy and Dave's European Tour 2000 — Dave Thomas <Dave@...>

24 messages 2000/08/30
[#4653] Re: Andy and Dave's European Tour 2000 — matz@... (Yukihiro Matsumoto) 2000/08/30

Hi,

[#4657] Ruby tutorials for newbie — Kevin Liang <kevin@...> 2000/08/30

Hi,

[ruby-talk:4553] Re: Process.wait bug + fix

From: Brian Fundakowski Feldman <green@...>
Date: 2000-08-22 16:52:28 UTC
List: ruby-talk #4553
On Tue, 22 Aug 2000, Dave Thomas wrote:

> Brian Fundakowski Feldman <green@FreeBSD.org> writes:
> 
> > If your system uses the rb_waitpid() codepath of rb_f_wait(),
> > Process.wait will return prematurely if you have multiple child
> > processes.  The problem is that rb_waitpid() is called only once,
> > when it needs to be called until a you get an ECHILD error from
> > rb_waitpid().
> 
> Perhaps it's late and I should waiting until morning before posting,
> but...
> 
> I'm not sure I see the problem. Process.wait waits for _a_ child to
> terminate, not all children. Your patch seems to reap them all.

That's what I expected Process.wait to do :(  That's how Bourne/Korn
shells do it.  Perhaps then there should just be a Process.waitall;
this is an important primitive.  It smells like a real hack to do

pid = -1
while true
	begin
		npid = Process.wait
	ensure
		break if $!.is_a?(Errno::ECHILD)
		raise $!
	end
	pid = npid
end

or something when shells already provide the ability.

> Regards
> 
> 
> Dave

--
 Brian Fundakowski Feldman           \  FreeBSD: The Power to Serve!  /
 green@FreeBSD.org                    `------------------------------'


In This Thread