MySQLdb multithreaded

Skip Montanaro skip at pobox.com
Wed May 7 14:51:52 EDT 2003


    Greg> Integer constant stating the level of thread safety the interface
    Greg> supports.  Possible values are:

    Greg> 0= Threads may not share the module.
    Greg> 1= Threads may share the module, but not connections.
    Greg> 2= Threads may share the module and connections.
    Greg> 3= Threads may share the module, connections and cursors.

    Greg> MySQLdb.threadsafety == 1 for the latest version so each thread
    Greg> must have its own connection.

Yes, but I think the definition of threadsafety == 1 is perhaps a bit
misleading.  Only one thread at a time may access a connection, but the
connection doesn't have to be thrown away after that thread is done with it.
(Maybe the definition is clear, but MySQLdb is actually more like a 1.5.)

Skip






More information about the Python-list mailing list