3.4. Using libdbi in multithreaded applications

With some precautions, libdbi can be used in multithreaded applications. One way to do this is to initialize separate libdbi instances in each thread. If this is not an option and several threads have to share a single instance, you currently need to protect certain libdbi function calls with mutexes. These functions are dbi_conn_query, dbi_conn_ping, and dbi_conn_error.