$dbh=... $sth->execute() $sth->bind_columns(...) t1= new Thread \&processor; t2= new Thread \&processor; t1->join(); t2->join(); #ends here# sub hitMe { # :locked? $sth->fetch(); return (columns...); } sub processor { my $dbconn.... my $dbh... while(@data=hitme()) { process stuff; $dbh->something(); } }