Kjell Irgens writes:
 > I notice now that my dbi_conn_error() is also protected  with the same 
 > scoped mutex as dbi_conn_query().
 > 
 > I use the same connection in several threads without this causing any 
 > problems (apart from having to use the mutex).
 > 

Hi,

I've added the following section to the docs:

--8<---
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.
--8<---

Emmanuel, Kjell, Ethan: with your experience in running multithreaded
libdbi apps, do you think this section is appropriate and sufficient?

regards,
Markus

-- 
Markus Hoenicka
http://www.mhoenicka.de
AQ score 38

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Libdbi-drivers-devel mailing list
Libdbi-drivers-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-drivers-devel

Reply via email to