From: Logan Capaldo Date: 2007-02-25T03:24:17+09:00 Subject: Re: threads within a thread On Thu, Feb 22, 2007 at 04:33:15AM +0900, Gary Wright wrote: > > On Feb 21, 2007, at 2:19 PM, Jason Roelofs wrote: > > >Since you're writing this in Ruby, I have to suggest that you just > >write > >this single-threaded. Ruby uses green threads, meaning it handles > >it's own > >threading and not the system, leading to on average decreased > >execution time > >vs single-threaded. > > If you were talking about CPU bound jobs that might be true, but > probing networks has lots of inherent I/O latency. Green threads should > be just fine for this sort of thing as you are basically waiting on > various packets to return from the probed hosts. > Actually, (appealling to authority here :) ) I believe Francis has stated in the past that the Thread overhead kills the advantage for even IO bound tasks (in Ruby specifically) and that a select loop is better. > Gary Wright > > >