changeset 16:56cd6800acb5

write slide No.11 & add images
author Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
date Wed, 29 Jan 2014 17:32:39 +0900
parents 9b071b32e3de
children 2d1060de4dfe
files slide/images/divide_read.png slide/images/mmap.png slide/index.html
diffstat 3 files changed, 71 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
Binary file slide/images/divide_read.png has changed
Binary file slide/images/mmap.png has changed
--- a/slide/index.html	Wed Jan 29 16:12:51 2014 +0900
+++ b/slide/index.html	Wed Jan 29 17:32:39 2014 +0900
@@ -112,13 +112,83 @@
       </article>
 
       <article>
-        <h3>mmap での I/O の実装</h3>
+        <h3>mmap での I/O の実装(1)</h3>
+        <br>
+          <h3 class="yellow">FileRead.h の一部</h3>
+        <pre>
+typedef struct fileRead {
+    struct fileRead *self;
+    long fd;
+    long division_size;
+    long task_number;
+    long task_num;
+    long left_task_num;
+    long filesize;
+    long left_size;
+    int task_blocks;
+    char *read_text;
+    CPU_TYPE cpu;
+} FileRead, *FileReadPtr;
+</pre>
+      </article>
+
+      <article>
+        <h3>mmap での I/O の実装(2)</h3>
           <br>
+          <h3 class="yellow">Task の記述</h3>
+        <pre>
+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);
+}
+</pre>
       </article>
 
       <article>
         <h3>mmap の仕様</h3>
           <br>
+          <img src='images/mmap.png' style="height:300px">
+
+        <ul>
+          <li>
+          code がシンプル (read を書いて読み込まなくていいため)
+          </li>
+          <li>
+          memory より大きなファイルは開けない
+          </li>
+          <li>
+          read の先読みがOS依存
+          </li>
+        </ul>
+      </article>
+
+      <article>
+        <h3>divide read の設計</h3>
+          <br>
+          <img src='images/oneread.png' style="height:250px">
+          <br>
+
+        <ul>
+          <li>
+          明示的な read
+          </li>
+
+          <li>
+          先読みを自分で書ける(制御できる)
+          </li>
+
+          <li>
+          code が煩雑
+          </li>
+
+          <li>
+          memory より大きなファイルを扱える
+          </li>
+        </ul>
       </article>
 
   </body>