SQLite Forum

Is it possible to use WAL mode without using mmap() function ?
Login

Is it possible to use WAL mode without using mmap() function ?

(1) By anonymous on 2021-11-30 09:10:02 [link] [source]

Hello,

I saw the WAL mode can work without shared memory as long as the database is opened in exclusive locking mode. However, the SQLite code shows that it still link the mmap() function even the SQLITE_MAX_MMAP_SIZE is set to zero

#if !defined(SQLITE_OMIT_WAL) || SQLITE_MAX_MMAP_SIZE>0 { "mmap", (sqlite3_syscall_ptr)mmap, 0 },

#else { "mmap", (sqlite3_syscall_ptr)0, 0 },

#endif

It looks I have to omit WAL in order to remove the dependency to the mmap() function.

My question is how to use WAL but without linking mmap() function, is it possible ?

(2) By anonymous on 2022-01-24 16:58:02 in reply to 1 [source]

Anyone can help?

(3) By anonymous on 2022-01-24 17:06:20 in reply to 1 [link] [source]

I want to use WAL mode in vxworks kernel mode. So, it is not necessary to use mmap to share memory among processes. All heap memory are visible by kernel. In this case, is it also possible to not force WAL to work in exclusive mode? Do I need to customize the VFS to accomplish this?

(4) By JustDoIT (JustDoIt) on 2023-01-19 01:06:12 in reply to 3 [link] [source]

based on the document, it could use WAL without mmap(),

WAL databases can be accessed in EXCLUSIVE mode without the use of shared memory. (Additional information)

but I don't know how

(5.1) By Stephan Beal (stephan) on 2023-01-19 01:10:10 edited from 5.0 in reply to 4 [link] [source]

but I don't know how

It's explained in detail in your other thread on the topic.

(6) By JustDoIT (JustDoIt) on 2023-01-19 13:47:48 in reply to 5.1 [link] [source]

no right answer in that thread. I want to get a solution to try