Is SQLite thread safe under this situation?

后端 未结 1 1163
轮回少年
轮回少年 2021-01-13 08:02

I require database access operations from several threads, through a singleton object, which holds a database connection. I read from SQLite3\'s website, saying that \'an sq

相关标签:
1条回答
  • 2021-01-13 08:22

    If the SQLite library is compiled with -DSQLITE_THREADSAFE you are OK with the more recent SQLite 3 versions.

    The author of SQLite says:

    Beginning with version 3.5.0, SQLite enforces this itself using its
    own internal mutexes, so the application is free to (try to) use the
    same database connection from multiple threads at the same time.

    0 讨论(0)
提交回复
热议问题