![]() I forgot that this forum engine sorts threads also by edit data. > Your dummy, no-real-changes editing makes me want to just block you. Replication of the struct data is a side problem, more of a distraction than the real issue. The real problem is not management of data held by some sqlite3 struct(s) it is management of the resources referenced by the struct(s). I would also suggest that you first find out how well use of simply redundant connections solves the problem that motivates your "clone" inquiry before getting to attached to that approach or disappointed that it is unsupported. Your objective of getting "similar" connection "configuration" could be achieved by using common code to get connections to the configuration you want, and keeping them in a pool instead of tossing them as threads are done or die. Those clones (if they existed), would have to be deep copies, little different from seemingly redundant connections unless the copies were made different by usage. Use of multiple connections to the same database is among the scenarios addressed there.īecause there are allocated resources associated with a connection, it is better to simply make additional connections to the same database if there will be different prepared statements in process. (See ().) You should study () to see what can be done to assuage your performance concerns. Critical database access must be serialized either way, either by the set of connection holders or the library itself. Even if you could get a cloned connection, it would perform no better in multi-thread scenarios. ![]() You need to simply use the multi-threading capability (such as it is) that SQLite already has. It is like a child crowding between a group of other children and an attention-giving adult.īTW, there is no API for cloning a connection. Your dummy, no-real-changes editing makes me want to just block you. And if you believe, after a reasonable period of time has passed, that the thread deserves more attention that it is getting, maybe then add something calculated to improve prospects for an answer. ![]() If you have something substantive to add, add it as another post. Will you please stop "editing" your post(s) just to change the timestamp? It is annoying and time-wasting. So I come to multi-thread mode.But there is problem with the synchronization of connection configs (they all should be same). An interrupt operation will be terminate all executing/planned queries. Queries will be running in sequental mode - one by one.Ģ. I can use Serialized mode: use one database connection and a separate thread per query.But there are two problems:ġ. The simpest way to stay GUI responsible is to use ().But in the single thread I can't run an another query in parallel. If steps running in main loop (main thread) in single thread mode, they will stop GUI. There are 3 threading modes: Single-thread, Serialized and Multi-thread. This statement is executed by typical calls Select avg(t.x * t2.x) from t, t2 order by random() T2(x) as (select x from t order by random()) WITH RECURSIVE t(x) AS (SELECT 1 UNION ALL SELECT x+1 FROM t LIMIT 10000), Let's assume we have a long time query e.g. ![]() As I understand, the WAL mode is used to readers do not block writers and a writer does not block readers.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |