How to use database connection in threads?
I 开发者_StackOverflowwant to use standard database connections in threads. Is it thread-safe?
Depends on the particular database implementation you are using. If the module conforms to the Python Database API Specification v2.0, it should have the threadsafety
global that will let you know what can be shared between processes and what not. I guess if it is not 0, you can multi-thread at least some of your DB code.
精彩评论