libdict
libdict copied to clipboard
Add mmap support
To support concurrent modification, I used advisory locks. The downside being that the updater needs to also lock the file using an exclusive advisory lock.
The alternative is not worrying about such things and instead just manually restart the dictionary service when the dictionary is updated. It's a viable solution since I don't expect dictionaries updating quite often.
The only change made was the addition of MmapCursor
as a Read + Seek
reader that is then passed into either Uncompressed
or Compressed
dict readers. This maintains the interface established in #18.
Depends on #18. Related to #4.
Index needs to have the same capability of updating to the newest version of the dictionary. Maybe check the metadata of the index file to see if it updated?
Thanks again. I had a mmap draft as well that I never finished. Good to see it finally appearing :).
Could we please postpone this until the comments that I put on #18 are resolved? I would expect anyway some rebasing to be necessary. Thanks