Paul Aitman wrote:
Quote:
Each thread I create, has its own Connection object to the database, but
I was just wondering what dangers are there lurking when multiple
threads try to write to the same table.
I have tried to program it to be as thread safe as possible, I was just
wondering if there were any specific dangers I should be aware of when
using MySQL++. |
Theoretically using one connection per thread should be completely safe,
regardless of the table. Realistically, I've had MySQL hang up from time to time
if I hit a single table too hard from multiple threads. I'm not sure that's the
culprit, but either way, it's been a pretty nasty occurance in my test
environment, and I'm happy to work to avoid it if I don't get mysql hangups by
doing so.
Threads cause lots of odd behavior in general, and it's rarely clear what
particular issue is actually causing the behavior. Make sure you're using the
threadsafe library (I assume there is a threadsafe DLL for windows), that was
definitely key in my early experiments.
--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw