Boost logo

Boost :

Subject: Re: [boost] [afio] Formal review of Boost.AFIO
From: Asbjørn (lordcrc_at_[hidden])
Date: 2015-08-28 05:12:35


On 28.08.2015 07:47, Thomas Heller wrote:
> Now, on to your example about a 100 parallel reads, so let's encapsulate it a
> bit to concentrate on the important part:
>
> future<void> read_items(handle const & h)
> {
> vector<future<vector<char>>> reads;
> reads.reserve(100);
> for(std::size_t i = 0; i != 100; ++i)
> {
> reads.push_back(async_read(h, 4096, i * 4096));
> }
> // handle reads in some form ... for simplicity, just wait on all
> //of them ...
> return when_all(std::move(reads));
> }
>
> No continuations, cool, eh?

How would this affect performance?

 From what I can gather, with the current AFIO I should be able to issue the
entire batch of async read/write's to copy a file, using a single buffer (by
making a dependency chain using the preconditions).

In your API, won't those read/write calls have to take the trip into user land
for each step?

Sorry if I misunderstood something and this is just noise.

Cheers
- Asbjørn


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk