On Tue, 1 Mar 2011 17:45:26 +0900, Raphael Bauduin <rblists / gmail.com>
wrote:
> Hi,
> 
> As ruby threads are so called green threads, what's the behaviour when
> one thread is blocked on IO?
> If the thread is blocked on a system call, is the whole process, ie
> all threads blocked because the kernel scheduler considers the process
> as blocked on IO? Are there IOs blocking a thread without blocking the
> whole ruby process?
> 
> Thanks
> 
> Raphal

I'm new to threading, but from what I've been able to find, if the
currently active thread is blocked on IO, it should block the rest of them.
At least, certain circumstances could cause that. According to (the rather
old) post at http://www.justskins.com/forums/when-threads-block-107159.html
, it's possible to block on IO. My own tests are unable to confirm that,
even for large test sizes. My guess is that in the 7ish years since that
post, many improvements have gone into the interpreter. ;) The post at
http://stackoverflow.com/questions/3481866/thread-join-blocks-the-main-thread
has more information on ways of using them to not block each other.

http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_threads.html was
where I started for threading, but the only references I see to blocking in
it talk about the Thread.critical= method.

http://stackoverflow.com/questions/56087/does-ruby-have-real-multithreading/57802#57802
has a nice synopsis of the threading types between ruby implementations.