in reply to Re^3: mysqlPP has no driver CLONE() function so is unsafe threaded
in thread mysqlPP has no driver CLONE() function so is unsafe threaded
Guess the solution is to have the db obj in the dbUpdate function ONLY...my $dbh = DBI->connect("dbi:mysql:$db:$host", "$db_user", "$db_passwor +d", {RaiseError => 0, PrintError => 0} ) # We do the error check. May +be we dont wanna die if error! or errTrap("Cannot connect to the datab +ase"); threads->create(&dbUpdate()))->join; threads->create(&anotherThread()))->join; sub dbUpdate() { while(1) { do som db stuff when wanted } } sub anotherThread() { do stuff on shared variables that the db uses... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: mysqlPP has no driver CLONE() function so is unsafe threaded
by BrowserUk (Patriarch) on Aug 03, 2005 at 05:02 UTC |