4 ms·
In both Ruby 1.8 and 1.9, Ruby code will not cause all threads to block when the CPU is idle. However, poorly coded C libraries that blocked on IO without provi
by wycats 15y ago
In both Ruby 1.8 and 1.9, Ruby code will not cause all threads to block when the CPU is idle. However, poorly coded C libraries that blocked on IO without providing Ruby a file descriptor (via rb_thread_select) could cause all threads to block.
Those libraries have largely been fixed or replaced (e.g. mysql with mysql2). Ruby 1.9.2 also provides a mechanism for C code to release the GIL if it does not involve any Ruby code, which is used Blythe typecasting code in mysql2, for instance.