Vectored I/O Information & Vectored I/O Links at HealthHaven.com
advertise
add site
services
publishers
database
health videos
Bookmark and Share

search wiki for    ?
web dir firms image gallery news pdf wiki shop video 
about
toolbar
stats
live show
health store
more stuff
JOIN/LOGIN
Featured Results:
Vector Handpieces : Vector High Speed Handpieces Vector Low Speed...
Vector Handpieces : Vector High Speed Handpieces Vector Low Speed...
kabdental.com
 Vectors, NEW! NTC's Vector Services
Vectors, NEW! NTC's Vector Services
natx.com
 NCBI-BLAST2 Vectors Basic Local Alignment Search Tool for Searching...
NCBI-BLAST2 Vectors Basic Local Alignment Search Tool for Searching...
ebi.ac.uk
 

Vectored I/O, also known as scatter/gather I/O, is a method of input and output by which a single procedure call sequentially writes data from multiple buffers to a single data stream or reads data from a data stream to multiple buffers. The buffers are given in a vector of buffers. Scatter/gather refers to the process of gathering data from, or scattering data into, the given set of buffers. The I/O can be performed synchronously or asynchronously. The main reasons for using vectored I/O are efficiency and convenience.

There are several usages for vectored I/O:

  • Atomicity: If the particular vectored I/O implementation supports atomicity, a process can write from or read into a set of buffers to or from a file without risk that another thread or process might perform I/O on the same file between the first process' reads or writes, thereby corrupting the file or compromising the integrity of the input;
  • Concatenating output: An application that wants to write non-sequentially placed data in memory can do so in one vectored I/O operation. For example, writing a fixed-size header and its associated payload data that are placed non-sequentially in memory can be done by a single vectored I/O operation without first concatenating the header and the payload to another buffer;
  • Efficiency: One vectored I/O read or write can replace many ordinary reads or writes, and thus save on the overhead involved in syscalls;
  • Splitting input: When reading data that is in a format that defines a fixed-size header, one can use a vector of buffers in which the first buffer is the size of that header; and the second buffer will contain the data associated with the header.

The applicable functions readv[1] and writev[2] can be found in POSIX 1003.1-2001 and the Single UNIX Specification version 2. The Windows API has analogous functions ReadFileScatter and WriteFileGather; however unlike the POSIX functions they require each buffer to be aligned on a memory page.[3] Windows Sockets provide separate WSASend and WSARecv functions without this requirement.

While working directly with a vector of buffers can be significantly harder than working with a single buffer, there are often higher level APIs[4] for working efficiently that eliminate the problem.

[edit] References

  1. ^ readv in the Single Unix Specification
  2. ^ writev in the Single Unix Specification
  3. ^ ReadFileScatter in MSDN Library
  4. ^ Vstr the Vectored String API



Product Results (view all...)

search wiki for    ?
web dir firms image gallery news pdf wiki shop video 



↑ top of page ↑about thumbshots