List:MySQL++« Previous MessageNext Message »
From:Jim Wallace Date:March 5 2009 1:34am
Subject:Confirmation about thread un-safety/safety
View as plain text  
I know you can't use the same connection object on different threads.
It looks like I can 't do query.store() on one thread and
query.store_next() on another since it calls
conn_->driver()->next_result();

 

But I could the following, true?  Do store()/store_next() to get the
result sets on thd1 then pass the results to the2 and just call
result.at() and row.at() on the other thread, which doesn't use the
connection.  Any other gotchas?  (Looks like using res.fetch() would not
be good.)

 

thd1

res1 = query.store();

res2 = query.store_next();

res 3 = query.store_next();

 

 

thd2

for( ...res1.num_rows()...)

                row.at(i).at(0)

 

for( ...res2.num_rows()...)

                row.at(i).at(0)

 

 


Thread
Confirmation about thread un-safety/safetyJim Wallace5 Mar
  • Re: Confirmation about thread un-safety/safetyWarren Young5 Mar
    • RE: Confirmation about thread un-safety/safetyJim Wallace5 Mar
      • Re: Confirmation about thread un-safety/safetyWarren Young5 Mar
      • Re: Confirmation about thread un-safety/safetydan g.5 Mar