Boost logo

Boost :

Subject: Re: [boost] [afio] AFIO review postponed till Monday
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2015-07-21 22:43:29

On 21 Jul 2015 at 21:51, Glen Fernandes wrote:

> > The NT kernel API is exceptionally stable as any changes to it
> > Microsoft and anyone who writes device drivers dearly.
> Even when I worked at Microsoft (not that long ago; I left in
2014), in
> the teams/orgs I was in, we wouldn't even consider using any
> undocumented NT APIs in our code: What you're doing is brave. I'm
> suprised no AFIO users (if people are already using AFIO) have
quoted an
> old post like
> seeing you use those APIs.

Sorry, I didn't see you originally said "undocumented APIs". It's
like 3am
here :)

AFIO doesn't use any undocumented APIs nor behaviours. All the kernel
it uses are from the official Microsoft kernel documentation e.g.
here is
the docs for NtCreateFile
). aspx.

The link you quoted is where someone was using truly undocumented
structure layouts which suddenly changed. That isn't a problem with
official and fully documented NT kernel API.

If I said undocumented APIs anywhere in the AFIO docs, please do tell

> > What your comment has made me realise is that it would make much
> > sense if there were a "normal persons tutorial" and an "advanced
> > tutorial" where the former is a nice hand holding all-portable
> > steps thing, and the latter is stuff like writing distributed
> > exclusion algorithms solely via atomic append onto the filesystem
> > is in the current tutorial. How does that plan sound?
> It's your library, and you know your target audience. I would only
> suggest you consider that for any given example that you have
> decorated with platform-specific code / conditional code to
> some point or the other, just make sure it passes the test that any
> potential customer of AFIO is going to issue: "Could I implement
> this example is trying to achieve using much less [perhaps
> platform-specific] code, and achieve the same level of
performance?". If
> the answer is "no", then you have nothing to worry about.

Really with async file i/o it's always more a question of control
than performance. In the naïve case performance will usually be
higher by
going synchronous.

The last section in the current tutorial demonstrates this: your
algorithm which is great with a warm cache can perform extremely
poorly on
a cold cache hard drive. AFIO lets you more easily tune your
through trial and error to work well in both cold and warm cache
scenarios, and moreover to do so portably.

That was its original use case. Now with the race free filesystem
extensions, and given there is absolutely no portable reusable
library I
am aware of which abstract those across platforms anywhere at all,
have changed. If you were wanting to write portable code capable of
working under a changing filesystem you get no choice but AFIO right
in any language (that I am aware of).

I think I should be presenting at CppCon about the race freedom
Right now I'm between jobs, so I may have to cancel Seattle if my new
employer requires it :(


ned Productions Limited Consulting

Boost list run by bdawes at, gregod at, cpdaniel at, john at