-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 29/01/12 07:44, Mikael wrote: > Can you please clarify what the xShm* VFS operations are supposed to > do: xShmMap, xShmLock and SQLITE_SHM_NLOCK, xShmBarrier and xShmUnmap.
Have you tried reading the source? Look for unixShmMap/winShmMap and that same pattern for the other functions. > I'd suppose Sqlite uses the latter three as functional equivalent to > mutexes to guarantee state/data consistency in parallell access to the > mapped memory? Map maps the wal index into shared memory, unmap does the opposite. The lock operation provides locking (shared, exclusive etc). Barrier does this: http://en.wikipedia.org/wiki/Memory_barrier > And furthermore, by shared memory in this scope, do we mean a memory > allocation that is shared between apps (without a mirror on disk), No, it is the wal-index file that they are all viewing/modifying. > we mean a disk file where the OS provides a conveniency wrapper for > fread and fwrite such that the app can now do this by accessing a > particular interval or memory addresses instead. No, it is doing this: http://en.wikipedia.org/wiki/Memory-mapped_file fread/fwrite use their own buffering. Changes to a memory mapped file are instantly seen by all others with the same memory mapping ("instant" can be slightly fuzzy, maybe requiring a memory barrier). > If I remember right, previously on the ML, a person said that a WAL > database could be opened by several nodes on a networked filesystem > simultaneously. SQLite does not work with networked filesystems, because networked filesystems tend to have bugs in the way SQLite uses them. Memory mapped files definitely don't work on networked filesystems as changes won't be seen by all with a mapping if clients are on different machines. I suggest reading the wal doc again - networking is mentioned right at the top: http://www.sqlite.org/wal.html > I'd like to be able to understand if this is correct or not - need to > understand what the xShm* and foundation for the mapping as per above > is for this though. If you don't have memory mapped files available on your OS then don't use WAL. If you do then use the existing Unix or Windows implementations that closest match your OS. Roger -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk8liPwACgkQmOOfHg372QQNDgCcDX4Ne0B05pceM/WnalXzxByl DY4Ani+q2dVlDp8zQ8iWiBf9bzO0KAxN =CfGO -----END PGP SIGNATURE----- _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users