# HG changeset patch # User Masataka Kohagura # Date 1390987756 -32400 # Node ID 2d1060de4dfe59de59b4fc6a5d697462a1677112 # Parent 56cd6800acb54318d0d127d600f540f0c693779a write divide read の実装 diff -r 56cd6800acb5 -r 2d1060de4dfe slide/index.html --- a/slide/index.html Wed Jan 29 17:32:39 2014 +0900 +++ b/slide/index.html Wed Jan 29 18:29:16 2014 +0900 @@ -176,20 +176,33 @@
  • 明示的な read
  • -
  • 先読みを自分で書ける(制御できる)
  • -
  • code が煩雑
  • -
  • memory より大きなファイルを扱える
  • +
    +

    divide read の実装(1)

    +
    +

    Task の記述

    +
    +mmap(SchedTask *s, void *in, void *out)
    +{
    +    FileReadPtr fr = (FileReadPtr)in;
    +    int map = MAP_PRIVATE;
    +
    +    fr->read_text =
    +        (char*)mmap(NULL,fr->filesize,PROT_READ,map,fr->fd,(off_t)0);
    +}
    +
    +
    +