Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Ruby 1.8 implements threads in userspace, so if a native extension is blocked on I/O then no context switching is possible in the first place (unless the native extension is using Ruby's own I/O functions, in which case Ruby will relinquish control to another Ruby thread).

Ruby 1.9 implements native threads, so a native extension blocked on I/O will be rescheduled by the kernel, assuming that the native extension unlocks the GIL before performing the I/O operation.



Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: