我试图为我的多线程应用程序创建共享内存数据库,但似乎不起作用。我用过:
sqlite3_open("file:memdb1?mode=memory&cache=shared", &self->readdb)
就像这里描述的:
https://www.sqlite.org/inmemorydb.html
但是它只是创建了名为
file:memdb1?mode=memory&cache=shared
似乎只是普通的文件:
lapsio@linux-tiph > stat file:memdb1\?mode=memory\&cache=shared
File: 'file:memdb1?mode=memory&cache=shared'
Size: 9216 Blocks: 24 IO Block: 4096 regular file
Device: 2fh/47d Inode: 109010 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ lapsio) Gid: ( 100/ users)
Access: 2018-06-24 13:46:48.435300970 +0200
Modify: 2018-06-24 13:47:07.139406989 +0200
Change: 2018-06-24 13:47:07.139406989 +0200
Birth: -
我的sqlite版本是
sqlite3 --version
3.8.10.2 2015-05-20 18:17:19 2ef4f3a5b1d1d0c4338f8243d40a2452cc1f7fe4