[DBD-SQLite] DBI, DBD::SQLite and threads

Tim Bunce Tim.Bunce at pobox.com
Mon Mar 26 20:18:10 GMT 2012


Thanks Kenichi.

Since no one has suggested any particular version I'll disable the
DBI thread warning for perl >= 5.12.

Tim.


On Tue, Mar 20, 2012 at 02:40:22PM +0900, kenichi ishigaki wrote:
> Hi. I don't usually use the "threads" module in my projects, but...
> 
> 1) DBD::SQLite has several tests that use fork(), that means emulated
> fork() (with ithreads) under Windows, and they've been working fine
> for years.
> 
> 2) DBIS/dTHR issue was fixed at DBD::SQLite 1.22_04 (released in
> April, 2009) by Tim's advice.
> 
> 3) Docs on SQLite3's thread safety:
>   - http://www.sqlite.org/compile.html#threadsafe
>   - http://www.sqlite.org/c3ref/threadsafe.html
>   - http://www.sqlite.org/faq.html#q6
> 
> 4) DBD::SQLite is compiled with the default THREADSAFE option if your
> perl supports ithreads, or THREADSAFE=0 (single thread mode)
> otherwise.
> 
> 5) As a general rule, a) you shouldn't use DBI handles prepared
> outside the threads, and b) you're advised to set
> sqlite_use_immediate_transaction attribute to true (or issue BEGIN
> IMMEDIATE) to avoid (dead)locks.
> 
> Regards,
> 
> Kenichi

> 
> 2012/3/19 Tim Bunce <Tim.Bunce at pobox.com>:
> >>
> >> When you build DBI it still says:
> >>
> >> *** You are using a perl configured with threading enabled.
> >> *** You should be aware that using multiple threads is
> >> *** not recommended for production environments.
> >>
> >> but I'm unsure to what degree this still applies.
> >
> > I think that could be removed, at least for recent perls.
> > I wonder if there's some version where a good number of thread issues
> > got fixed. Perhaps 5.10, 5.12? Would anyone using thread havily care to
> > venture an opinion?



More information about the DBD-SQLite mailing list