Chinaunix首页 | 论坛 | 博客
  • 博客访问: 437261
  • 博文数量: 67
  • 博客积分: 2468
  • 博客等级: 上尉
  • 技术积分: 1050
  • 用 户 组: 普通用户
  • 注册时间: 2011-01-05 01:21
文章分类

全部博文(67)

文章存档

2013年(1)

2012年(65)

2011年(1)

分类: 嵌入式

2012-02-13 23:06:05

1,异步阻塞I/O,异步非阻塞I/O???
      同问题5。

2,aiocb(AIO control block)结构体的内容?
     /include/linux/aio.h(内核版本为2.6.36.1)也没有找到。???

3,/proc/sys/fs/aio-nr文件,/prco/sys/fs/aio-max-nr问文件?
      好奇,看看两个是什么文件。

4,kiocb结构体的内容?
      在内核/include/linux/aio.h(内核版本为2.6.36.1)文件中
  1. struct kiocb {
  2.     struct list_head    ki_run_list;
  3.     unsigned long        ki_flags;
  4.     int            ki_users;
  5.     unsigned        ki_key;        /* id of this request */

  6.     struct file        *ki_filp;
  7.     struct kioctx        *ki_ctx;    /* may be NULL for sync ops */
  8.     int            (*ki_cancel)(struct kiocb *, struct io_event *);
  9.     ssize_t            (*ki_retry)(struct kiocb *);
  10.     void            (*ki_dtor)(struct kiocb *);

  11.     union {
  12.         void __user        *user;
  13.         struct task_struct    *tsk;
  14.     } ki_obj;

  15.     __u64            ki_user_data;    /* user's data for completion */
  16.     loff_t            ki_pos;

  17.     void            *private;
  18.     /* State that we remember to be able to restart/retry */
  19.     unsigned short        ki_opcode;
  20.     size_t            ki_nbytes;     /* copy of iocb->aio_nbytes */
  21.     char             __user *ki_buf;    /* remaining iocb->aio_buf */
  22.     size_t            ki_left;     /* remaining bytes */
  23.     struct iovec        ki_inline_vec;    /* inline vector */
  24.      struct iovec        *ki_iovec;
  25.      unsigned long        ki_nr_segs;
  26.      unsigned long        ki_cur_seg;

  27.     struct list_head    ki_list;    /* the aio core uses this
  28.                          * for cancellation */

  29.     /*
  30.      * If the aio_resfd field of the userspace iocb is not zero,
  31.      * this is the underlying eventfd context to deliver events to.
  32.      */
  33.     struct eventfd_ctx    *ki_eventfd;
  34. };

5,
同步I/O
        P185上说,Linux上最常用的的I/O模型是同步I/O。这个模型放出I/O请求后,应用程序就会阻塞,直到请求满足为止。调用应用程序在等待I/O请求完成时不需要占用CPU。
       这是什么意思哦???似乎同步,异步;阻塞,非阻塞让人很晕哦。感觉只是从不同角度的描述。
   http://blog.csdn.net/historyasamirror/article/details/4270633
“http://www.cppblog.com/converse/archive/2009/05/13/82879.html
首先来解释同步和异步的概念,这两个概念与消息的通知机制有关.其次再来解释一下阻塞和非阻塞,这两个概念与程序等待消息(无所谓同步或者异步)时的状态有关.
   http://blog.csdn.net/tq02h2a/article/details/3825114

6,AIO从来不需要改变文件的位置
        P191。不理解。可能是因为对AIO的认识还不够深吧。看到很多地方只是扔出这句话,体会不到具体的意思哦。那同步IO呢?
阅读(1834) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

时间看来2012-05-23 08:53:14

后来,看UNP,v1时在I/O模型中看到有很详细的解释……