From: Szymon Rozga Date: 2007-11-07T05:50:18+09:00 Subject: Re: Long running SQL query via ActiveRecord blocking the entire Ruby process? It is my understanding that Ruby threads are green threads. see: http://en.wikipedia.org/wiki/Green_threads "Also a green thread may block all other threads if performing a blocking I/O operation. In order to avoid these problems, green threads must use asynchronous I/O operations, but the added complexity increases latency." I seem to remember reading about Ruby threads and IO blocking, but cannot find it. Hope the above answers some questions. Does anyone know of a solution? -Szymon On Nov 6, 3:26 pm, estebanj...@gmail.com wrote: > To my surprise, a long running SQL query via ActiveRecord blocks an > entire Ruby process (all the other threads are blocked while the > thread that runs the SQL query is waiting for the result set) > > Has anyone else found this to be the case? (am I mistaken?) > Is there any way to avoid this other than spawning a separate process? > > [Ruby version 1.8.4, ActiveRecord version 1.14.4 on Linux] > > -Steve