mysqldb + multi-threading
hg at nospam.com
Sat Sep 9 16:46:12 CEST 2006
> I am writing a transaction server (socket-based) under windows.
> I use mysqldb to log info into MySQL.
> It is all working and I need now to decide whether to use forks
> (CreateProcess I guess) or threads.
> I saw in another thread that some db engines did have issues with being
> called from threads.
> My gut feeling is to use threads (note: each transaction is finite, so
> the process/thread die fairly quickly).
> Any insight ?
A thread on the mysqldb forum:
By: Rob Steele - robsteele
RE: Do I need to enable thread safe mysql lib
Yup. You also need to either synchronize the reading and writing threads
so that only one can get at the database at a time or else open a second
connection. You should probably use sepearate connections, one for each
More information about the Python-list