From: Shay Hawkins Date: 2010-01-04T22:41:58+09:00 Subject: Re: "Dummy" IO object to push and pull data? Shay Hawkins wrote: > It creates the thread properly, but when the sleep expires and it is > ready to call stdin.puts(), it cannot do anything, because the loop > continued around and it is reading from stderr. However, when it > receives a new set of input from stderr, since the stream is momentarily > being unused, it can then grab the stdin stream and properly input the > old line. Hm, let me give an example of what this would output. The process that I'm creating the stream for outputs something every 10 seconds. As I mentioned, if it outputs a 0, I want to give it an input of "Received 0 five seconds ago." five seconds later. 0:00:00 - Program started. 0:00:10 - Output: 3 0:00:20 - Output: 0 0:00:30 - Output: 2 0:00:30 - Input: Received 0 five seconds ago. It's a rough example, yes, but the point is that stdin seems to wait until stderr is free. I understand this may be normal, but is there an alternative to select() that will prevent me from tying up the streams if there's no ready data in stderr? -- Posted via http://www.ruby-forum.com/.