From: Michael Bevilacqua-Linn Date: 2007-10-10T01:11:55+09:00 Subject: Re: thread problem..... ------=_Part_6958_21265555.1191946315290 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Ah probably what 7stud7 was getting at as well, and yeah, you're right. However, if you read the OPs description, an i/o bound problem doesn't seem likely. MBL On 10/9/07, khaines@enigo.com wrote: > > On Tue, 9 Oct 2007, Michael Bevilacqua-Linn wrote: > > > 1.) The only way threads get you a speedup is when you write your code > in > > such a way that sections of it can be executed in parallel so you can > take > > advantage of multiple cores (or processors). > > > > 2.) The current version of Ruby only supports green threads anyhow. So > even > > if you did have multiple cores, you wouldn't get a speedup. > > It's not that simple. With Ruby's green threads, it all depends on > whether there's a latency somewhere, in one thread, that can allow another > > to make use of that time and get something done. > > You aren't going to find that latency in any CPU bound operation, and you > aren't going to find that latency in any extension to Ruby that was not > written to be Ruby aware. > > If your problem is IO bound, though, ruby can capture that time where one > thread is waiting on IO to let another thtread do something. In those > cases, you can get a speedup from Ruby's green threads. > > > Kirk Haines > > > ------=_Part_6958_21265555.1191946315290--