# Hang with write

**URL:** <https://www.ruby-forum.com/t/hang-with-write/122959>\
**Category:** Development\
**Created:** [December 13, 2007, 12:45am UTC](https://www.ruby-forum.com/t/hang-with-write/122959 "2007-12-13T00:45:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tanaka\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/c67d28/32.png) [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Post date:** [December 13, 2007, 12:45am UTC](https://www.ruby-forum.com/t/hang-with-write/122959/1 "2007-12-13T00:45:27Z")

</div>

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
