Menu

#16 Multithreading

open
None
5
2006-08-19
2006-04-21
Anonymous
No

Let's consdier sample case. I have a simple program
that starts numerous threads. In thread routine I
create Connection object and try to connect to
database. The problem is that in Connection objects
MYSQL* are equal so I ve got errors.

Discussion

  • Jonathan Wakely

    Jonathan Wakely - 2006-08-19

    Logged In: YES
    user_id=426241

    (sorry for the late reply)

    You haven't given enough information to know what's wrong.

    If you share a Connection between threads you will have a
    problem (this includes taking copies of an existing Connection)

    If you create a new Connection in each thread it should work.

    You might want to look at mysql++ instead - recently it's
    more actively developed and supported than mysqlcppapi

     
  • Jonathan Wakely

    Jonathan Wakely - 2006-08-19
    • assigned_to: nobody --> redi
     

Log in to post a comment.