From: Jeremy Kemper Date: 2006-09-23T05:34:15+09:00 Subject: Re: Threading and the MySQL ------=_Part_36471_302548.1158957250978 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 9/22/06, Frederick Cheung wrote: > > We've noticed the following slightly odd behaviour when executing long > running queries to mysql using the native ruby gem (in some ActiveRecord > code running in backgroundrb but the problem is not connected to > activerecord) versus using the pure ruby mysql adaptor All the ruby threads are blocked during execution of the query. > If however I use the pure ruby mysql adaptor then I get a line of output > every second even when the query is running, which is obviously the more > desirable solution. See also ruby-talk:71672 The mysqlclient has no nonblocking API so you won't get the desired behavior until Ruby has native threads. For what it's worth, postgres offers a nonblocking API and the native gem (and Active Record) support it. Backgroundrb could be more robust in this respect by forking instead of threading jobs. jeremy ------=_Part_36471_302548.1158957250978--