From: brabuhr@... Date: 2007-07-20T02:12:58+09:00 Subject: Re: [BUG] threads and heavy io on osx and linux On 7/19/07, brabuhr@gmail.com wrote: > On 7/18/07, ara.t.howard wrote: > > i've tested on several platforms (*nixes) all all will hang if run a few > > times > > > > http://drawohara.tumblr.com/post/6123121 > > > > can someone confirm? Only seems to hang if the et or ot threads are joined in the popen3 block. Does not hang even with n > 1000 (though ruby segfaults with n > 2000): #ft = Thread.new{ sleep 5} et = Thread.new{ e.read } ot = Thread.new{ o.read } #et.join #ot.join #ft.join ft = Thread.new{ sleep 5} et = Thread.new{ e.read } ot = Thread.new{ o.read } #et.join #ot.join ft.join Hangs: et = Thread.new{ e.read } #ot = Thread.new{ o.read } et.join #ot.join #et = Thread.new{ e.read } ot = Thread.new{ o.read } #et.join ot.join et = Thread.new{ e.read } ot = Thread.new{ o.read } et.join #ot.join et = Thread.new{ e.read } ot = Thread.new{ o.read } ot.join et.join (I was going to try with file instead of pipe reading but then I forgot I was going to try that, so I didn't yet :-)