Skip to content

thread safety of single storage object? #207

@JCYang

Description

@JCYang

Is it threadsafe to use a single storage object globally?
I'm using this wrapper in our app. Initially I used thread_local storage object but I occasionally encounter bug which go down to libstdc++ share_ptr trigger segfault(which is quite unlikely a libstdc++ bug). Then I try to build with SQLITE_THREADSAFE=1 and switch to use magic static(global) storage object. One weird error happen, "can not open database file". Then I removed the old file, yet the second error happen, SQL logic error.
I write my own wrapper around the storage object and initialize then sync the scheme in the ctor of the wrapper. Can you please clarify whether the storage object is threadsafe?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions