From: ts Date: 2002-11-01T19:46:12+09:00 Subject: Re: "stack level too deep" error when trying to multithread in win32 using dbi >>>>> "C" == Carl Youngblood writes: C> I'm trying to do some multithreaded ruby programming on Windows, using C> the pragprogrammers' ruby167-5.exe installation. I've got MySQL C> working too and I'm using the DBI in my code. The thing is, ruby C> threads work fine if I don't call any DBI code. But if I do call DBI C> code, even if I completely close my connection before using any C> threads, I get a "stack level too deep" error. When I remove the DBI C> code, the threads work fine. Here is the threaded code: Can you give the complete example, I can't reproduce it with DBD::Pg aestivum% cat b.rb #!/usr/bin/ruby require 'dbi' require 'auth' begin DBI.connect('dbi:Pg:dbname=imgd', $user, $pass) do |dbd| dbd.prepare("select distinct map from map_location order by 1") do |sth| sth.execute p sth.column_names sth.each do |m,| p m end end end rescue DBI::Error puts $! end THREADCOUNT = 5 threads = [] THREADCOUNT.times do |i| threads << Thread.new do puts "got here" + i.to_s end end threads.each {|t| t.join } aestivum% aestivum% b.rb ["map"] "cm" "mapf2" "mnl" "mo17Xh99" got here0 got here1 got here2 got here3 got here4 aestivum% Guy Decoux