I'm trying to do some multithreaded ruby programming on Windows, using
the pragprogrammers' ruby167-5.exe installation.  I've got MySQL
working too and I'm using the DBI in my code.  The thing is, ruby
threads work fine if I don't call any DBI code.  But if I do call DBI
code, even if I completely close my connection before using any
threads, I get a "stack level too deep" error.  When I remove the DBI
code, the threads work fine.  Here is the threaded code:

------------------------

THREADCOUNT = 5

threads = []
THREADCOUNT.times do |i|
	threads << Thread.new do
		puts "got here" + i.to_s
	end
end
				
threads.each {|t| t.join }

------------------------

It's just a simple test to see if I can use threads.  It works fine if
I don't use the DBI, but if I call any DBI functions, it bombs on me
with an error like this:

../BankDB.rb:6:in `[]': stack level too deep (SystemStackError)
        from ./BankDB.rb:10:in `[]'
        from ./BankDB.rb:10:in `[]'
        from ./BankDB.rb:10:in `[]'
        from ./BankDB.rb:10:in `[]'
        from ./BankDB.rb:10:in `[]'
        from ./BankDB.rb:10:in `[]'
        from ./BankDB.rb:10:in `[]'
        from ./BankDB.rb:10:in `[]'
         ... 722 levels...
        from ./BankDB.rb:10:in `[]'
        from ./BankDB.rb:10:in `[]'
        from ./BankDB.rb:34:in `get_user_db'
        from D:\FoxServ\www\bank\bin\test.rb:4

Does anybody know if there is a way to get around this?

Thanks,

Carl Youngblood