Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use thread-safe connection #37

Closed
singpolyma opened this issue Jul 4, 2015 · 5 comments
Closed

Use thread-safe connection #37

singpolyma opened this issue Jul 4, 2015 · 5 comments
Labels

Comments

@singpolyma
Copy link

It is possible to have thread-safe sqlite3 connection handles, at which point DatabaseConnection could implement Sync and be shared between threads.

@dckc
Copy link
Owner

dckc commented Jul 23, 2015

The rest of the data structures would have to be Sync too, yes? I wonder if I'll find time to think this thru...

@ericsink
Copy link

Seems problematic.

SQLite's thread safety supports three modes. The Really Thread Safe mode (serialized) is often the default, but not always. This depends on how the library was compiled. And it is also possible to compile SQLite with this mode omitted from the build.

So if rust-sqlite3 is dynamically loading the sqlite3 library from "wherever", and I assume it is but have not checked, it cannot know how the library was compiled.

@dckc
Copy link
Owner

dckc commented Jul 29, 2015

Actually, it could check with sqlite3_threadsafe.

@dereckson
Copy link

The rest of the data structures would have to be Sync too, yes?

Only the data structures used by sqlite3::DatabaseConnection.

So, the first candidate is std::rc::Rc<sqlite3::core::Database>.

@dckc
Copy link
Owner

dckc commented Jan 6, 2017

This is now Somebody Else's Problem :)
See #46

@dckc dckc closed this as completed Jan 6, 2017
@dckc dckc added the wontfix label Jan 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants