Ken <[EMAIL PROTECTED]> wrote: > Hi all, > > I have a piece of code that utilizes test_server.c, (master thread) > > there are 3 threads, each performing seperate tasks, that get a > conection (shared) and set PRAGMA read_uncommitted=1. > My understanding is that this would allow each individual thread > to concurrently execute a select statement?
Please reread the comments on test_server.c. When shared cache is enabled, database connections must remain in the same thread in which they are created. And the cache is only shared between connections in the same thread. Thus the read_uncommitted=1 pragma only effects connections in the same thread. The intent of shared cache and read_uncommitted=1 is to allow SQLite to be used to build an in-process database server thread. The server thread can open multiple connections to the same database file, one connection for each client, such that all connections share the same cache. This gives performance advantages and also reduces memory consumption on low-memory embedded devices. SQLite uses table-level locking in a shared cache, for increased concurrency. And if read_uncommitted is turned on, SQLite never locks out a read request for an even bigger concurrency boost. Look at test_server.c and see that it starts a separate server thread that handles all database operations on behalf of clients. The clients do not themselves attempt to access the database. Instead, each client sends its database requests to the server thread, the server processes the request on behalf of the client, then sends the results back to the client. -- D. Richard Hipp <[EMAIL PROTECTED]> ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------