I'm writting a multi-threaded app that connects to a mysql server. What I'm trying to decide is how each thread will connect.
I've come up with two basic options:
1) Have one MYSQL variable and use mutex controls so only one is able to read/write at a time
2) Each thread would have its own MYSQL variable but setup a mutex method so only one can write at a time.
I'm leaning towards #2 but I'd like to hear your opinions and/or other ideas.