__generic_file_aio_write – write data to a file

1. __generic_file_aio_write – write data to a file

 ssize_t __generic_file_aio_write(struct kiocb * iocb, const struct iovec * iov, unsigned long nr_segs, loff_t * ppos);

iocb    IO state structure (file, offset, etc.)

iov     vector with data to write

nr_segs number of segments in the vector

ppos    position where to write


2. Classroom

Asynchronous I/O,  or non-blocking I/O,  is a form  of input/output
processing  that permits  other processing  to continue  before the
transmission has finished.  Input  and output (I/O) operations on a
computer  can  be extremely  slow  compared  to  the processing  of
data. An  I/O device can  incorporate mechanical devices  that must
physically move,  such as  a hard drive  seeking a trackto  read or
write; this is often orders  of magnitude slower than the switching
of  electric current.  For example,  during a  disk  operation that
takes ten milliseconds  to perform, a processor that  is clocked at
one     gigahertz    could     have    performed     ten    million
instruction-processing cycles.   A simple approach to  I/O would be
to start the  access and then wait for it to  complete. But such an
approach (called  synchronous I/O or blocking I/O)  would block the
progress  of a  program  while the  communication  is in  progress,
leaving  system  resources idle.  When  a  program  makes many  I/O
operations, this means  that the processor can spend  almost all of
its   time   idle  waiting   for   I/O   operations  to   complete.
Alternatively, it is possible,  but more complicated to predict, to
start the  communication and then perform processing  that does not
require  that  the  I/O  has  completed. This  approach  is  called
asynchronous input/output.  Any task  that actually depends  on the
I/O having completed (this includes both using the input values and
critical operations that claim to assure that a write operation has
been  completed) still  needs  to  wait for  the  I/O operation  to
complete, and thus is still blocked, but other processing that does
not have a dependency on the I/O operation can continue.

source : http://en.wikipedia.org/wiki/Asynchronous_I/O

Leave a comment

Your email address will not be published. Required fields are marked *