Dear list,

I understand WAL recently got the option of only relying on a
db-file-global lock in order to behave correctly across sqlite instances
accessing the same file.

At the same time, I presume the other access option, which is based on the
presence and functioning of the shared memory features in the underlying
VFS, has benefits. While I'm aware shared memory functionality is
widespread in all kinds of OS:es, I have a hard time getting a clue of how
exactly sqlite uses them, even after reading the sourcecode of their
implementations in sqlite's code.

Can you please detail how those VFS procedures and their arguments are
defined and how a VFS implementation that implements them is required to
function to deliver for all of Sqlite's current requirements:
     xShmMap (Is the point that to ensure that a particular byte range in
the wal or db file is kept in memory and thus that ordinary xRead/xWrite
are supposedly higher speed, or does it allocate a block of RAM that all
processes doing the same mapping command get r/w access to, or what?)
     xShmLock and SQLITE_SHM_NLOCK
     xShmBarrier
     xShmUnmap (Drops all locks and mappings for the file, or what?)

Ultimately, is the point with WAL using shm to get a more fine-grained
access to files, or a kind of IPC message passing functionality across
sqlite instances, or both?

If you could give a rough example of how a session of
opening/accessing/closing a sqlite WAL DB looks in terms of
sqlite3_io_methods calls (the parts that relate to shm in particular) and
briefly the point with the respective calls, would be much appreciated.

As of today, are the VFS shm functionality (xShm* procedures) only used
when in WAL mode and for the WAL files only?

Also, what the benefits you see are with going with shm instead of the
file-global locking mode for a WAL DB? Is the main benefit more
fine-grained access to the wal/db files' contents and thus higher parallell
processing across sqlite instances?

Thanks and kind regards,
Mikael
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to