On 9/7/07, Pete DeLaurentis <[EMAIL PROTECTED]> wrote: > Here's one question that I think would have an impact on how useful > green threads are for many server apps: > > If you are blocking on something like a database SELECT in one green > thread, will the Ruby interpreter switch to another green thread > while it's waiting for the response? > > Or does a blocking request block all green threads?
When the flow of execution leaves Ruby and goes into some 3rd party extension (like that of a DB library), then ruby can't context switch. So yes, when one does a DB query that is going through a C extension, all of the other green threads are blocked, so that latency can't be captured. If it could be, then yes, there would be some benefit from some number of green threads per process for typical web apps. Kirk Haines _______________________________________________ Mongrel-users mailing list Mongrel-users@rubyforge.org http://rubyforge.org/mailman/listinfo/mongrel-users