4 ms·
I think Alex is wrong about the GIL causing the VM to block on I/O. Ruby allows a thread to be scheduled when another is blocked on I/O (using rb_thread_select(
by sjtgraham 13y ago
I think Alex is wrong about the GIL causing the VM to block on I/O. Ruby allows a thread to be scheduled when another is blocked on I/O (using rb_thread_select()). In the past 3rd party libs with poorly written C extensions, e.g. mysql gem, didn't take advantage of this functionality hence the effect of threads being blocked with idle CPU. This is no longer the case. However, it should be noted that a single thread runs at a time in YARV.
JRuby does not have a GIL (or GVM (Global VM lock) as it's been called since 1.9), he can use that now if he wants true concurrency, with threads truly executing in parallel.
- maccman 13y agoYes, I think you're right, my article isn't accurate. I'm going to publish an update.