nobu, your patch looks fine to me.  However, my original uses less memory
and time on Alex's test on my Phenom II

[ruby-core:66430]
  17.64user 0.01system 0:17.64elapsed 100%CPU (0avgtext+0avgdata 9544maxresident)k

[ruby-core:66457]
  28.84user 0.01system 0:28.84elapsed 100%CPU (0avgtext+0avgdata 14172maxresident)k

Unfortunately, no word from Alex, yet...

On a related issue, Ctrl-C seems to be ignored with Alex's original
code.  I'll have to dig through the threads/signal handling code again
to see what's wrong... (on Linux x86-64)