Thread-Safety of Multi-Thread Connection

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Thread-Safety of Multi-Thread Connection

Jesse Rittner
I have some questions about multi-thread (as opposed to serialized, see
https://www.sqlite.org/threadsafe.html) connections.

1. If I have two multi-thread connections that are using a shared cache, is
it safe to use those two connections concurrently with each other?
2. Same as (1), but what if it's an in-memory database?
3. Is it safe to use sqlite3_interrupt (from a different thread) on a
multi-thread connection? I don't see how else sqlite3_interrupt could be
used, so I'm not sure if it's a serialized-only feature.

Thanks!



--
Sent from: http://sqlite.1065341.n5.nabble.com/
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Thread-Safety of Multi-Thread Connection

Richard Hipp-3
On 12/31/18, Jesse Rittner <[hidden email]> wrote:
> I have some questions about multi-thread (as opposed to serialized, see
> https://www.sqlite.org/threadsafe.html) connections.
>
> 1. If I have two multi-thread connections that are using a shared cache, is
> it safe to use those two connections concurrently with each other?
> 2. Same as (1), but what if it's an in-memory database?
> 3. Is it safe to use sqlite3_interrupt (from a different thread) on a
> multi-thread connection? I don't see how else sqlite3_interrupt could be
> used, so I'm not sure if it's a serialized-only feature.

Yes to all of the above.

--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users