On 17 Feb 2017, at 8:54am, Clemens Ladisch <clem...@ladisch.de> wrote:

> Bob Friesenhahn wrote:
> 
>> Does anyone have an idea about this specific problem that we encountered?
>> 
>> It is not clear to me if this is a threading issue, or memory corruption 
>> issue
> 
> It's probably memory corruption causes by a threading issue.
> 
> The original mail said:
> 
>> Any thread may acquire and use this one database connection at any time.
> 
> Add a mutex. Lock it before beginning _any_ transaction (read or read/write),
> and unlock it only after the transaction has finished.

You may or may not want to use SQLite’s own mutex routines:

<https://www.sqlite.org/c3ref/mutex_alloc.html>

> Alternatively, give each thread its own connection.

Often the route which leads to a program which is simpler to read and only a 
tiny bit slower.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to