On Wed, Aug 16, 2017 at 4:15 PM, Keith Medcalf <kmedc...@dessus.com> wrote:

> Setting "multithreaded" mode disables these checks in the SQLite3 library
> and it is up to the application level code to ensure the single-entrance
> per connection is enforced at the application level.  If the application
> makes a "mistake" and violates the rules then corruption and not nice
> consequences will ensue.  However, since the SQLite3 core is no longer
> passing through a mutex on each entry, the code runs slightly faster.
>
> Setting "single-threaded" mode disables all mutexes in the library and is
> intended for use when the code is entirely single threaded.  Since there is
> no protection at all (even for the VFS layer) if you perform any kind of
> multiple-entrance nasty consequences may ensue.
>
> Generally speaking if you leave the default "serialized" mode, then you
> are protected against accidental re-entrancy application errors on multiple
> threads at a price penalty for the extra safety.
>

+1 Keith. Very useful, thanks! I actually find this clearer than the doc on
this subject, which is a bit too terse IMHO.

I understand one doesn't want to explain implementation details too much in
doc,
but Keith's "annotated" version made it "click" in my head better, when the
doc didn't.

The doc is not wrong of course, just too terse for my liking (as a
developer). My $0.02. --DD
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to