From: Robert Klemme Date: 2008-08-07T20:17:00+09:00 Subject: Re: Threaded IO trouble 2008/8/7 Michal Suchanek : > On 07/08/2008, Robert Klemme wrote: >> >> And it misses another line at the beginning: >> >> $defout.sync = true >> >> :-) > > Fixing the mockup is not the right way, Maybe I am missing your point but the buffering in the mock client is certainly delaying the complete process. Also, I did not only add that line to mock.rb but provided a different client implementation. Did you actually try it out? > I need the ruby script working > with the application which is represented by the mockup. Also doing 5 > repetitions is insufficient to test for the problem. It fails only in > few % of cases. Well, you can imagine that I did not want to post 1,000,000 lines here. Do the errors you report show up with my code when increasing the number of lines? I usually start with a simple bit to verify the basic functionality is ok and build from there. I do not understand, why you go to all this fd duplicating stuff. Also, I find your processor quite complex and it seems that for the error you are seeing a simpler program will be sufficient. Btw, what does "writing causes stdin to be read into the program" exactly mean? Cheers robert -- use.inject do |as, often| as.you_can - without end