From: Idan Sofer Date: 2002-12-14T04:43:04+09:00 Subject: Re: TCP Server Bill Kelly wrote: > > >I prefer to use select() than threads, for a couple reasons, in Ruby. >My sense is that, since the whole process is blocked (all your threads) >if one of your IO calls stalls (in any thread), then you have to find >a way to do non-blocking IO whether you're using threads or not. And I >personally find select() to be sufficient to the task without bothering >with threads. (It may just be personal opinion, or preference. :) > > I have not encountered such situation when using threads. My application have a set of worker threads, which either serve a client, waiting on a Mutex protecting accept(), or waiting at accept(), so there is always one thread waiting on accept(), and the application does not block. I suppose Ruby does some tricks to overcome the blocking. Idan.