Richard Hipp wrote:
> sqlite3 db ./foo -vfs unix-dotfile
>
> That uses an alternative VFS that uses dot-file locking instead of
> posix advisory locks. The dot-file locks are someone slower and have less
> concurrency, so the use of "PRAGMA locking_mode=EXCLUSIVE" might also be a
> good idea in such a configuration.
Looking at your code, I see that unix-dotfile locks are in reality
always exlusive. My guess is that the existence of a separate file
indicates that a process owns the (unique) lock, and non-existence
indicates no one owns the lock.
I see you defer to open(2) with O_EXCL to get atomicity here.
The docs leave something unclear:
If I ATTACH a database with pragma locking_mode=EXCLUSIVE under the
unix-dotfile VFS, get a lock on the attached db, execute a write
transaction on it, and then DETACH the database, then I'm assuming the
lock on the attached db is released. Is that right?
Eric
--
Eric A. Smith
I still maintain the point that designing a monolithic kernel in
1991 is a fundamental error. Be thankful you are not my student.
You would not get a high grade for such a design.
-- Andrew Tanenbaum, to Linus Torvalds
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users