My application creates a in-memory database (:memory:) using sqlite as a back end.
I want my master thread to create a connection to a in-memory database and this connection to be shared by multiple threads. Is this possible? SQLite 3.7.8 is available for download right now.
Is the shared cached a possible way to go?
If you open the connection to your in-memory database using serialized mode, then the connection may be shared among multiple threads.
For this to work, your SQLite must be compiled threadsafe — this is the default.
Depending on your application, you may get better performance with a large shared cache to an on-disk database, or with WAL mode if you have many reader threads.
Example: