comp.lang.ada
 help / color / mirror / Atom feed
From: Maciej Sobczak <see.my.homepage@gmail.com>
Subject: Re: API design problem - buffer scatter I/O
Date: Wed, 26 Nov 2008 00:34:18 -0800 (PST)
Date: 2008-11-26T00:34:18-08:00	[thread overview]
Message-ID: <2559d62b-68bb-4107-9e6b-75f77114908f@d23g2000yqc.googlegroups.com> (raw)
In-Reply-To: ggenha$ute$1@aioe.org

On 24 Lis, 18:16, tmo...@acm.org wrote:

> > The problem is that this is a single, continuous array.

>   Is this an actual problem?

Not im my case, really. Actually, I made up the I/O part because I
didn't want to expose the real problem case. I have still got an
excellent feedback that allowed me to fill the blanks in what I do and
it really helped. :-)

We can still argue (for the sake of technical discussion) that the
single buffer can be a problem even for real I/O, because it *might*
imply the use of dynamic memory, which for some reasons we might want
to avoid. Having a set of static buffers and custom scheme of
associating them with the fragments of the data stream might be an
interesting solution.
Of course, you could still argue that in the case of real I/O it might
be done with just a sequence of separate I/O calls for each involved
buffer, so again scatter operation is not necessary, but then the
counterargument would be for example atomicity of the whole data
transfer. And so on.

> In most systems copying the bytes from
> an IO buffer into different places will be a small percentage of the
> time taken by the actual IO, so the simplicity of a single IO buffer
> is worth the modest cost.

Yes.
But then, the I/O might be an interprocess communication based on
shared memory where "copying bytes" is the only factor and therefore
not at all a small percentage. And so on. ;-)

--
Maciej Sobczak * www.msobczak.com * www.inspirel.com

Database Access Library for Ada: www.inspirel.com/soci-ada



  reply	other threads:[~2008-11-26  8:34 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-22 16:05 API design problem - buffer scatter I/O Maciej Sobczak
2008-11-22 16:54 ` sjw
2008-11-22 19:43 ` george.priv
2008-11-22 22:16 ` Robert A Duff
2008-11-22 23:34   ` Maciej Sobczak
2008-11-23  0:01     ` Robert A Duff
2008-11-24  8:10       ` Brad Moore
2008-11-24  7:55   ` christoph.grein
2008-11-24 20:03     ` Robert A Duff
2008-11-25  5:59       ` christoph.grein
2008-11-25  8:34         ` Dmitry A. Kazakov
2008-11-25 14:25         ` Robert A Duff
2008-11-25 22:20       ` Randy Brukardt
2008-11-24 21:23     ` Robert A Duff
2008-11-22 23:01 ` Georg Bauhaus
2008-11-23  5:57 ` anon
2008-11-24 17:16 ` tmoran
2008-11-26  8:34   ` Maciej Sobczak [this message]
2008-11-26 20:39     ` sjw
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox