[Date Prev][Date Next] [Chronological] [Thread] [Top]

Fwd: Using sendfile with lmdb



Eric thank you I would have never considered that as an issue.
I tried out your code and saw the problem.
You saved me going down a rabbit hole.

Many Thanks

On Thu, Apr 2, 2015 at 5:33 PM, Eric Wong <e@80x24.org> wrote:
James Rouzier <rouzier@gmail.com> wrote:
> Hey Guys,
>
> I am working on a proof of concept of a simple key value store service
> using lmdb as the back end.
> I am using sendfile to avoid an extra copy.

Be careful if you're overwriting any data in LMDB.

zero-copy sendfile means any data queued up in the kernel will be
subject to modifications as the underlying file is updated, so your
client may se data it was not intended to see.

I wanted to do the same thing as you last year but ended up writing a
patch to the sendfile manpage instead:

https://git.kernel.org/cgit/docs/man-pages/man-pages.git/patch?id=7b6a3299776b5c1c4f169a591434a855d50c68b4