-
Notifications
You must be signed in to change notification settings - Fork 81
Closed
Description
I recently ran into an issue where I happened to be sharing a DB connection across a Threads.@threads
for
loop. I am wondering if it would be useful to expose the sqlite3_config
function (or a subset of the configuration) in api.jl
to allow SQLite's threading mode to be selected. Something like:
function sqlite3_config_threads(thread_config::Int)
return ccall( (:sqlite3_config, libsqlite),
Cint, (Cint,),
thread_config)
end
This way a user could specify sqlite3_config_threads(SQLite.SQLITE_CONFIG_SERIALIZED)
before opening the first database, which should allow sharing the DB across Julia threads.
Or, even better yet (in my opinion) is SQLite.jl
attempting to set SQLITE_CONFIG_SERIALIZED
when the SQLite
module is first loaded. I don't see a downside - assuming that the cost of the mutex inside the SQLite code base is pretty minimal for single threaded applications.
Metadata
Metadata
Assignees
Labels
No labels