I/O implementation question# Unix - 噫吁兮,危乎高哉
g*o
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
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