libdict icon indicating copy to clipboard operation
libdict copied to clipboard

Add mmap support

Open mscofield0 opened this issue 2 years ago • 3 comments

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.

mscofield0 avatar Apr 14 '22 13:04 mscofield0

Depends on #18. Related to #4.

mscofield0 avatar Apr 14 '22 13:04 mscofield0

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?

mscofield0 avatar Apr 14 '22 13:04 mscofield0

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

humenda avatar Apr 24 '22 17:04 humenda