Re:Time to First Tweet
by sjtgraham on Wednesday July 17, 2013 @07:37PM
(#6060733)
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.
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.