From: Tanaka Akira Date: 2004-02-27T13:59:38+09:00 Subject: Re: ruby-dev summary 22877-23014 In article <20040226144929.GP379@atdesk.com>, Paul Brannan writes: > The question should not be whether this method is useful in most cases, > but instead whether this method is useful in enough cases to warrant > including it. My point is that sysread (or sysread like method which care stdio buffer) is better than nonblocking read. I think they are useful in similar cases. > If a programmer creates a child process and uses a parent processes's > file descriptor in the child, he'd better know what he is doing, whether > the non-blocking flag is set or not. I think usual program expects non-blocking flag is clear. For example, following problem is caused because cvs (stdio) doesn't expect stderr is nonbloking. http://groups.google.com/groups?th=e4df2fdc1f4f4950 http://sources.redhat.com/ml/bug-glibc/2002-08/threads.html#00041 http://sources.redhat.com/ml/bug-glibc/2002-08/threads.html#00186 Since there are much code which expect file descriptor which non-blocking flag is clear, nonblocking-mode should be avoided if possible. So Ruby should not recommend nonblocking IO by providing easy-to-use method to make IO nonblocking. However someone who know what he is doing can make IO nonbloking using IO#fcntl anyway. -- Tanaka Akira