Y
Hacker News
new
|
ask
|
show
|
jobs
by
dfranke
1716 days ago
That's what mmap is for.
1 comments
haydnv
1716 days ago
It might be possible to replace freqfs with mmap on a POSIX OS, but a) you would still have to implement your own read-write lock, and b) you would (I think probably?) lose some consistency in behavior across different host operating systems.
link
vlovich123
1716 days ago
Which OSes does this run on that doesn’t have some kind of mmap operation?
link
haydnv
1716 days ago
It should work on Windows (because tokio::fs works on Windows) although I have not personally tested this
link
julian37
1716 days ago
You can do mmap on Windows, eg.
https://github.com/danburkert/memmap-rs
link
gpderetta
1716 days ago
mmaps for read, explicit API for writing, a-la LMDB. Buggy readers can read inconsistent data but cannot corrupt the os.
link
otterley
1716 days ago
Corrupt the OS? How might that happen?
link
gpderetta
1716 days ago
Sorry, I meant the DB!
link