On 6/30/2016 12:39 PM, Jarred Ford wrote:
How are multiple concurrent readers that share the same connection handled?

A connection has a mutex. Every API call locks it on entry and releases on exit.

Do I need to create a separate connection for each reader in order to keep 
these from running serially?

Not necessarily. Multiple readers on the same connection can interleave (if you have a SELECT statement, fetching each row and each value in a row is a separate API call, so multiple readers can take turns getting their rows). This may or may not be sufficient for your application. If you have a difficult query that takes a long time to produce a row, then all readers would be locked out while it runs. If you just scan tables with simple fast queries, then interleaving may be good enough.

Will writers on separate connections block the readers from running queries?

Yes in journal mode, no in WAL mode.

I'm using PRAGMA read_uncommitted = true

This is only meaningful when using shared cache mode ( https://www.sqlite.org/sharedcache.html ). It does nothing otherwise.
--
Igor Tandetnik

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

Reply via email to