readv: parallel or sequential?

Poul-Henning Kamp phk at phk.freebsd.dk
Fri Dec 7 05:21:41 PST 2007


In message <fjbh4h$f5s$1 at ger.gmane.org>, Ivan Voras writes:
>This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
>--------------enig09F7468F9E992596CC57A5F2
>Content-Type: text/plain; charset=UTF-8
>Content-Transfer-Encoding: quoted-printable
>
>Dag-Erling Sm=C3=B8rgrav wrote:
>
>> But to return to what Ivan was asking, I think what the man page is
>> trying to say is that you can't use readv() to e.g. read individual
>> network packets into separate buffers (unless each packet just happens
>> to fit exactly within each buffer).
>
>What about streaming protocols like TCP? If, for example, I know I have
>a N-byte header, N2-byte body, couldn't readv handle it with two iovecs?

yes.

>But that's not why I started the discussion. I'm looking for a way to do
>"scattered" async IO on files (the intention: feed an array of offsets,
>lengths and buffers into the kernel, let it perform the requests in
>parallel, if it can) and started with this man page.

You want AIO

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.


More information about the freebsd-fs mailing list