I think I finally figured out when Ruby's threads yield to each other: every 10ms! When the first thread gets launched (not main thread) Ruby will do one of two things:- set up a system timer (setitimer-style) to signal the process every 10ms
- create a new native thread that sleeps for 10ms betwee
Some notes on threading as I find them...I'm guessing at some of this because there's practically no commenting in the 250-line rb_thread_schedule function.I. Scope appears to be dup'ed when creating a new thread. I think we may "move" the existing scope to the new thread.
II. When scheduling the n