in reply to Re^2: dbi & threads
in thread dbi & threads

You cannot share DB-handles ($dbh) across threads. No matter what you do, you can't. What you're currently running afoul of is the fact that, as far as I understand the threads::shared documentation, it does not share variables deeply, and likely the hash will contain nested subhashes.

Even if you succeeded with that, you will run against the problem that the XS portions of DBI and the DBD are not threadsafe. Also read the below remarks that using multiple threads for concurrent DB access will not improve performance anyway.