From: stan Date: 2002-10-26T06:48:24+09:00 Subject: problem with threading mysql queries in ruby --=-a30JtgUaoPc6BHuX+WG6 Content-Type: text/plain Content-Transfer-Encoding: 7bit I'm having a problem with threads and the mysql module. I've trolled the archives and haven't found anything similar. It seems that once a thread containing a mysql query gets some cpu time it won't let go until the query is finished. Some testing with strace on linux and truss on solaris seems to confirm this- once the query is submitted to the server, read() is called and nothing else happens until it returns. I've attached a small test script which demonstrates the problem I'm having. So does the mysql module just not play nice with threads, or is there something I'm doing wrong here? Any suggestions for alternative ways of getting periodic feedback on the status of a long mysql query? Any help or suggestions would be greatly appreciated. -- Stan Hiller Systems Administrator LocalNet Corp shiller@localnet.com --=-a30JtgUaoPc6BHuX+WG6 Content-Disposition: attachment; filename=mysqlthread.rb Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; name=mysqlthread.rb; charset=ANSI_X3.4-1968 #!/usr/bin/ruby -w require 'mysql' @dbConn =3D Mysql.new("10.0.7.24", "freerad", "gO0b73fR", "radius") def threadTest() call =3D Thread.new { sleep 3 @connRes =3D @dbConn.query("select count(*) from radacct") } while (1) puts call.status sleep 1 end call.join end threadTest() --=-a30JtgUaoPc6BHuX+WG6--