On Mon, 3 Oct 2005, Tanaka Akira wrote:

> In article <3AF4F3D8-8D17-4E06-9F52-B8B5A4230AD5 / reverberate.org>,
>  Joshua Haberman <joshua / reverberate.org> writes:
>
>> Hrm, so I guess that if I want to do real nonblocking I/O in Ruby, I
>> have to write IO#nonblock_read and IO#nonblock_write, that do not
>> have this retry behavior?
>
> IO#sysread and IO#syswrite is possible candidates.
> However they may block when multithreaded because select.
> Also they cannot be combined with buffering methods.
>
> Nonblocking methods such as IO#nonblock_read and
> IO#nonblock_write is good idea.  If matz accept it, I'll
> implement them definitely.  However I'm not sure that matz
> think the method names are good enough.

thanks so much for doing this work!

suggestions:

   IO#nb_read
   IO#nb_write

or objectify:

   nbio = NBIO::new an_io

   nb.read 42  #=> will not block
   nb.write 42 #=> will not block

etc.

this would be a great addition - a good name must be found! ;-)

-a
-- 
===============================================================================
| email :: ara [dot] t [dot] howard [at] noaa [dot] gov
| phone :: 303.497.6469
| Your life dwells amoung the causes of death
| Like a lamp standing in a strong breeze.  --Nagarjuna
===============================================================================