由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - I/O implementation question
相关主题
Re: Thank you and.Re: a question about lower IOwhat is kernel locking
如何设置一机多屏???Help
regular expression中回车用什么表示?What is a jiffy in linux?
emacs下如何switch buffer?simple unix question
【贴图】这个人的Emacs + GDB 是怎么做出来的? (转载)问题:gentoo的gcc编译的CFLAGS
还是只认3.6G内存,大虾分析一下把 (转载)Looking for Linux kernel developer
error in my function "write_log"solaris 9/10 ld.so local root shell bug
升级kernel失败正在下载opensolaris源代码 (转载)
相关话题的讨论汇总
话题: buffer话题: kernel话题: user话题: question
进入Unix版参与讨论
1 (共1页)
g****o
发帖数: 1284
1
I know in traditional I/O, we usually hire two buffers to handle the I/O
operation: a kernel buffer and a user buffer. If a thread send a read request,
it traps in the kernel and blocks. Data first is transferred from device to
kernel buffer, and from kernel buffer to user buffer at last. After the
transferring is finished, the thread returns from kernel and continue its
execution.
Suppose I want to implement asynchronous I/O like this way: A user lever
thread sends a read request then immediate
t******q
发帖数: 117
2
It is belived that the buffered I/O are more effiecent than
the direct unbuffered i/o, since os will schedule the filebuffer -> user
buffer
transfer.
usually, you need to call fflush to make sure the fwrite out the
data from filebuffer to disk. since the schedule thing, it is not
safe to assume the data is out unless you force it write out.
if you fprintf to stdios, sometime you have to fflush the file pointer
to see the output. Maybe that is the reason.
read the FILE structure.

request,
reque

【在 g****o 的大作中提到】
: I know in traditional I/O, we usually hire two buffers to handle the I/O
: operation: a kernel buffer and a user buffer. If a thread send a read request,
: it traps in the kernel and blocks. Data first is transferred from device to
: kernel buffer, and from kernel buffer to user buffer at last. After the
: transferring is finished, the thread returns from kernel and continue its
: execution.
: Suppose I want to implement asynchronous I/O like this way: A user lever
: thread sends a read request then immediate

p******f
发帖数: 162
3
you answered the wrong questions.

【在 t******q 的大作中提到】
: It is belived that the buffered I/O are more effiecent than
: the direct unbuffered i/o, since os will schedule the filebuffer -> user
: buffer
: transfer.
: usually, you need to call fflush to make sure the fwrite out the
: data from filebuffer to disk. since the schedule thing, it is not
: safe to assume the data is out unless you force it write out.
: if you fprintf to stdios, sometime you have to fflush the file pointer
: to see the output. Maybe that is the reason.
: read the FILE structure.

c********e
发帖数: 417
4
There should be a way to do direct I/O. The kernel locks (after page-in
if necessary) the user buffer and pass the S/G list to device driver.

【在 g****o 的大作中提到】
: I know in traditional I/O, we usually hire two buffers to handle the I/O
: operation: a kernel buffer and a user buffer. If a thread send a read request,
: it traps in the kernel and blocks. Data first is transferred from device to
: kernel buffer, and from kernel buffer to user buffer at last. After the
: transferring is finished, the thread returns from kernel and continue its
: execution.
: Suppose I want to implement asynchronous I/O like this way: A user lever
: thread sends a read request then immediate

1 (共1页)
进入Unix版参与讨论
相关主题
正在下载opensolaris源代码 (转载)【贴图】这个人的Emacs + GDB 是怎么做出来的? (转载)
How to understand 'global zone' in solaris?还是只认3.6G内存,大虾分析一下把 (转载)
Solaris(TM) Internals: Solaris 10 and OpenSolaris Kernel Architecture (2nd Edition)error in my function "write_log"
[转载] Trace/BPT trap(coredump)?升级kernel失败
Re: Thank you and.Re: a question about lower IOwhat is kernel locking
如何设置一机多屏???Help
regular expression中回车用什么表示?What is a jiffy in linux?
emacs下如何switch buffer?simple unix question
相关话题的讨论汇总
话题: buffer话题: kernel话题: user话题: question