Hang with write

e$B0J2<$N$h$&$K$9$k$He(B ^C e$B$,8z$+$J$$>uBV$K4Y$j$^$9!#e(B

% ./ruby -rio/nonblock -ve 'r, w = IO.pipe
w.nonblock = true
p w.write_nonblock(“a” * 100000)
w.nonblock = false
t1 = Thread.new { p w.write(“b” * 4096) }
t2 = Thread.new { p w.write(“b” * 4096) }
sleep 1
p r.sysread(4096).length
t1.join
t2.join

ruby 1.9.0 (2007-12-12 patchlevel 0) [i686-linux]
65536
4096
4096
^C

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs