I run in iOS. The mmap is enable in recent version.
So, once a mmap enable, data may lost after os crash unless msync. But I can’t 
find anywhere in the source of SQLite call the msync. Is it a bug?


原始邮件
发件人:Dan kennedydanielk1...@gmail.com
收件人:sqlite-userssqlite-us...@mailinglists.sqlite.org
发送时间:2016年11月3日(周四) 17:38
主题:Re: [sqlite] Is msync necessary for SQLite?


On 11/03/2016 02:13 PM, sanhua.zh wrote:  I notice that SQLite may not call 
msync for mmap. Instead, it calls the fsync.  As my search, fsync does not 
imply the msync. See 
this,https://groups.google.com/forum/#!topic/comp.unix.programmer/pIiaQ6CUKjU   
 So, is it necessary call a msync for SQLite? Probably not in the default 
configuration, at any rate. SQLite mmap-mode only works if the system has a 
unified page-cache. Which is why it is disabled on some platforms (OpenBSD and 
others IIRC). Also, unless SQLITE_MMAP_READWRITE is defined at compile time, 
SQLite uses write() calls to modify to the db file, even though it reads the 
file by memory mapping it. Dan. _______________________________________________ 
sqlite-users mailing list sqlite-users@mailinglists.sqlite.org 
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to