From: Paul Lutus Date: 2006-10-21T15:10:12+09:00 Subject: Re: threaded Socket call blocks main thread joost baaij wrote: > Hi all. A blocking IO issue is puzzling me, maybe someone can offer > any insights. > > I have written a plugin for Rails that does dns requests (to real- > time blackhole lists). It works quite well. I am doing the dns > requests (using Socket.gethostbyname) in separate threads. > Unfortunately, when the call to Socket blocks, the main thread is > blocking as well. And even though I have specified a parameter to > thread.join, the script won't kill the blocked thread. Obviously when you join the thread, it can block the main thread. But in my experience with Ruby threads, if you don't join the thread, it dies. Which leads a reasonable person to ask "what's the point of the threads?" -- Paul Lutus http://www.arachnoid.com