简体   繁体   中英

How to make SQLite use mutex based locking instead of file locking in Windows?

I have a multi process Windows application that uses SQLite locally on the disk.

When one process creates contention on the DB, other processes are starved since they poll for the DB and are not "notified" by the OS scheduler when no locks are being held (like mutexes do).

I found a built-in VFS called unix-namedsem for WXWorks, perhaps that's what I'm looking for - only for Windows.

Is there an existing solution for my problem? Or must I implement my own VFS?

The Windows VFS does not implement Mutex locking, and there is no other such VFS for Windows.

You have to implement that VFS yourself, or simply modify your own DB functions to lock a mutex around all transactions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM