in reply to Re^5: How to create thread pool of ithreads
in thread How to create thread pool of ithreads
Instead of creating DBI connection on the fly if it is managed from already created pool of DBI connections we can speed up the operation.
Sorry for the delay in reponding, there is a lot to say about this, and much of it I have no first hand experience of.
However, there are some signs of light.
But the onus is on the user to a) use the pure-Perl versions; b) check that the underlying, vendor-provided C-libraries used by the DBD/database in question are themselves thread-safe.
The database itself will often, of necessity, serialise concurrent queries affecting the same table(s), as it will need to lock the table(s) (including foriegn key dependancy tables), until a transaction is completed or rolled back.
The situation may be improved if the database supports and is using record (tuple) locks, but even then, if the query can affect (require updates to), one or more indexes, it may still need to serialse the queries.
The upshot is that it often makes sense to serialise your queries yourself.
Its a complex field and you would probably get better answers going to the DBI forums and describing your application requirements in more detail.
|
|---|