>>>>> "y" == yannick  <yannick / dazzlebox.com> writes:

y> Thanks you for your answer, but that's not really what I meant. I know
y> than by closing the socket you unblock it anyway, but I would like to
y> know why there is a difference between reading a non blocking IO in the
y> main thread and reading it in another thread.

 Re-read your script, you have 2 threads : the main thread waiting that
 `thr' finish  and `thr' waiting for reading a character or EOF.

 They are blocked : even if the read is non-blocking, the control is given
 to the main thread (which wait for the termination of `thr') which give
 the control to `thr' (which try to read a character) which give the
 control to the main thread (which wait for the termination of `thr'), etc 


Guy Decoux