rb_thread_select() is deprecated under Ruby 1.9.x (and currently broken ([ruby-core:39095)] in trunk/1.9.3 as of 20110824) in favor of rb_thread_fd_select(). Ruby 1.9.3+ also offers the rb_wait_for_single_fd() API which is easier-to-use and (transparently) provides a minor performance improvement under Linux where the ppoll() syscall is available. Ruby 1.9.3 will fall back to the same logic used in rb_thread_fd_select() on non-Linux platforms when using rb_wait_for_single_fd(). Emulation using rb_thread_select() for older platforms is provided. This patch is tested on Ruby trunk r33022, 1.9.2-p290, and 1.8.7-p334. Full disclosure: I co-implemented rb_wait_for_single_fd() for Ruby 1.9.3 with Motohiro Kosaki.