> On Mar 6, 2017, at 7:10 AM, Наиль Шигапов <[email protected]> wrote: > > Today for fetch or write information from different thread, i lock thread if > database is lock(write, read,e.t.c) But i don’t want lock my thread. I read > from documentation about «vfs» technology in sqlite. Does it make sense to > create vfs object and write information there, while database lock, and then > write information if the database unlock.
No, the VFS API is for implementing your own storage layer underneath SQLite. It wouldn’t help with multithreading. If you want multiple threads to be able to read from the database simultaneously, then your best bet is to create a small pool of SQLite connections and have the thread grab a connection from the pool, do its work, then return the connection. Also, you should enable WAL mode, so you’ll be able to read from the database while another connection is writing. There’s nothing you can do about multiple simultaneous writes, though — SQLite allows only a single connection to have a write-lock on the db at a time. —Jens _______________________________________________ sqlite-users mailing list [email protected] http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

