SQLite Forum

Multi-threaded non-serialization
Login
Note that setting the NOMUTEX flag enables "multi thread" mode, which allows concurrent access by multiple threads, each using their own connection.

The pattern you describe for your first attempt is consistent with running into a database lock and a busy handler sleeping for a bit (millisecond range) before trying again. You should not be running into a database lock for concurrent read transactions. Could you be inadvertently setting up write transactions instead?

The pattern you describe for your second attempt should also allow concurrent reads, but is consistent with write transactions. Especially as read_uncommitted is supposed to turn off read locks, but your threads are obviously blocked.

The increase is not "execution time" but rather "wait time" due to ms granularity of the default busy handler, activated by setting a busy timeout.