> Le 28 d?c. 2015 ? 08:27, Dan Kennedy <danielk1977 at gmail.com> a ?crit : > > It's because (at least historically - may have changed?) win32 does not > support advisory locks. So if you take an EXCLUSIVE lock on a range of bytes > no other process can read them. This is different from Unix, where all locks > are advisory - one process locking a range of bytes does not prevent another > from reading them, only from taking a conflicting lock. > > For this reason we need a range of bytes that are never read by SQLite to > take locks on (otherwise we couldn't have readers running concurrently with > the writer). The reason the selected range is out at 2^30 instead of, say, at > the start of the file, is to avoid forcing really small databases to be > larger than they would otherwise have to be. > > It doesn't matter that database files are usually less than 2^30 bytes in > size. All the (main?) platforms support locking regions of a file that have > not yet been populated. > > Dan.
Thank you Dan for this authoritative answer. :) It's perfectly clear now. > It doesn't matter that database files are usually less than 2^30 bytes in > size. All the (main?) platforms support locking regions of a file that have > not yet been populated. I suspected this, but I didn't have to use file locking APIs for so many years (lucky me!), so I really wasn't sure at all about this. -- Meilleures salutations, Met vriendelijke groeten, Best Regards, Olivier Mascia, integral.be/om