Bug 1869060 Comment 12 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Mike Conley (:mconley) (:⚙️) from comment #9)
> (In reply to Mike Conley (:mconley) (:⚙️) from comment #8)
> Reading https://www.sqlite.org/threadsafe.html and going through searchfox, it seems that the SQLite instance used by mozIStorageService doesn't declare a threading mode at build, run or connection time. The documentation says that in that case, we're falling back to serialized mode, and that means we _can_ use handles between threads (access through those shared handles is serialized using mutexes).

Yes, we use serialized threading, differently from Rusqlite that uses multithreading mode. The reason is we use Sqlite objects from the same connection across multiple threads.
Long term it would be better if we'd switch to the Rusqlite approach, that i think is more performant. Though, that requires everything using pure sync or pure async connections with a single thread (that means Places must complete its async transition), and that also means here it would be better to not introduce another thread.
I was mostly thinking about our internal threading checks anyway, rather than SQLite's, as we manage shutdown, not them.

Thank you for the updates. I agree that we could start exposing "something", and then hammer out the gory details with first use cases.
(In reply to Mike Conley (:mconley) (:⚙️) from comment #9)
> (In reply to Mike Conley (:mconley) (:⚙️) from comment #8)
> Reading https://www.sqlite.org/threadsafe.html and going through searchfox, it seems that the SQLite instance used by mozIStorageService doesn't declare a threading mode at build, run or connection time. The documentation says that in that case, we're falling back to serialized mode, and that means we _can_ use handles between threads (access through those shared handles is serialized using mutexes).

Yes, we use serialized threading, differently from Rusqlite that uses multithreading mode. The reason is we use Sqlite objects from the same connection across multiple threads.
Long term it would be better if we'd switch to the Rusqlite approach, that i think is more performant. Though, that requires everything using pure sync or pure async connections with a single thread (that means Places must complete its async transition), and that also means here it would be better to not introduce another thread.
I was mostly thinking about our (mozStorage) internal threading checks anyway, rather than SQLite's, as we manage shutdown, not them.

Thank you for the updates. I agree that we could start exposing "something", and then hammer out the gory details with first use cases.

Back to Bug 1869060 Comment 12