What posix_fadvise() args for sequential file write?

前端 未结 3 1524
不知归路
不知归路 2021-01-30 14:55

I am working on an application which does sequentially write a large file (and does not read at all), and I would like to use posix_fadvise() to optimize the filesy

3条回答
  •  离开以前
    2021-01-30 15:42

    It all depends on the temporal locality of your data. If your application won't need the data soon after it was written, then you can go with POSIX_FADV_NOREUSE to avoid writing to the buffer cache (in a similar way as the O_DIRECT flag from open()).

提交回复
热议问题