mdbm
mdbm copied to clipboard
Windows support
Hello,
are there any plans for Windows support? I have tried to compile with VS 2015, but there are some linux specific includes, like fcntl.h, sys/types.h. Apart from that Windows will need mmap port.
I don't see this working on windows due to the use of robust futexes, and mmap acts differently on windows. :)
However, it has been a really long time since I've looked at the apis on windows.
The locking was originally designed to be pluggable. We had the original ylock that was replaced with linux pthread locking. It should be possible to create a Windows plugin, but I wouldn't expect it to be easy. mmap implementations can also be a tricky point in how they treat map size rounding, and the page mapping interaction with (linux) remap_file_pages. Steve
On Thursday, September 8, 2016 8:39 AM, Allen Reese <[email protected]> wrote:
I don't see this working on windows due to the use of robust futexes, and mmap acts differently on windows. :)However, it has been a really long time since I've looked at the apis on windows.— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
@areese @steve-carney Thank you for your insights,guys :) Seems like i will have to move to linux platform, like 3/4 libraries which support on-disk datastore won´t compile or doesn´t work well on Windows. I have tried LMDB, but it didn´t perform very well.
@brano543 The original version of MDBM that came from Larry McVoy (many years ago) did support Win32, but it has been changed much since then. Thought I still had a copy, but couldn't find it. There are ports of mmap (i.e. https://github.com/witwall/mman-win32), but there will definitely still be some issues. As Steve mentioned, no robust locks, so if a process dies/exits holding a lock, you have to do messy manual cleanup. And certain features would have to be disabled (e.g. "windowed mode" because of remap_file_pages).
You might try out the new Ubuntu-in-userland mode for Win10 that MS just released, with the offending options disabled in Makefile.base. But I don't know if it will work. It sounds like there are still a number of issues (including pthreads problems).