2010/2/25 Yusuke ENDOH <mame / tsg.ne.jp>:

> Then, what should user care to avoid bizarre behavior?  IOW, what behavior
> can be guaranteed?  How about:
>
>  User must not read/write at the time multiple IOs that share the same
>  file descriptor or duplicated file descriptor.

In most case, STDIN/STDOUT/STDERR are inherited from a parent process.
So, they are shared by ruby and the parent.

Your idea forbids read/write for STDIN/STDOUT/STDERR.
It is too restrictive.

I think users should understand following property of I/O operations.
* read operations may use buffering.
  The operations may read more than minimal.
* write operations may use buffering.
  The operations may defer.
-- 
Tanaka Akira