From: Matthew Bloch Date: 2010-05-13T22:46:19+09:00 Subject: Re: Asynchronous HTTP request On Thu, 2010-05-13 at 22:29 +0900, Daniel DeLorme wrote: > > What's the problem with threads anyway? Being able to do one thing while > > you're waiting for something else to complete is exactly what they're > > for. > > I can't agree with that. Thread are meant to achieve *concurrency*, > meaning the concurrent (or at least interleaved) execution of > instructions. If the only thing the IO thread does is wait for the data > and then exit, there's nothing concurrent happening; it's just a way to > simulate nonblocking IO. And creating a thread just for that seems to me > like the proverbial jackhammer to drive in a nail, especially since 1.9 > threads are no longer green. I think you are trying to save the computer time at the expense of your own. What you are asking to do is reimplement something that Thread does very well, and without excessive resource usage. Even ruby1.8 can run thousands of sleepy I/O threads without a problem. The reason you can't find another library for doing what you want is that everyone uses threads. If you really want a jackhammer, use EventMachine :) -- Matthew