On Tue, 14 Feb 2017, Richard Hipp wrote:

On 2/14/17, Bob Friesenhahn <bfrie...@simple.dallas.tx.us> wrote:
Due to memory constraints
(at least 1MB is consumed per connection!), only one database
connection is used.  Any thread may acquire and use this one database
connection at any time.

<rant> This is yet another reason why I say "threads are evil".  For
whatever reason, programmers today think that "goto" and pointers and
assert() are the causes of all errors, but threads are cool and
healthful.  Entire programming languages are invited (I'm thinking of

Threads are a powerful tool but (like guns) they must be used very carefully.

In this particular case I think that the developer is making an assumption that more (partial) threading helps but with serialized access the database will still block and so perhaps it does not really help at all.

If we have two threads executing sqlite3_step() on the same connection
and using their own prepared statement, is there any magic in sqlite3
which would keep sqlite3_step() and sqlite3_column_foo() from
consuming (or disrupting) the results from the other thread?

Yes, that is suppose to work.  If you find a (reproducible) case where
it does not, we will look into it.

Thanks for this clarification. It is quite possible that the bug is outside of sqlite. The bug feels like a thread safety issue to me.

Bob
--
Bob Friesenhahn
bfrie...@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to