|
Boost : |
Subject: Re: [boost] [AFIO] Callback API
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2014-01-01 11:27:05
On 1 Jan 2014 at 12:31, Bjorn Reese wrote:
> > By "calling the next write operation", I'm thinking that you're
> > thinking that a kernel API ought to be issued right there and then
> > yes just like ASIO does?
>
> Yes.
>
> > understand exactly what you're looking for, and then I can implement
> > it.
>
> I have started working on a prototype to see how feasible it is.
Be aware I didn't reject the naïve ASIO-style API design due to the
API design itself. No, rather I rejected it because file i/o is
always blocking [1] and issuing kernel API calls immediately resulted
in pathological performance. In short, socket i/o API calls are nice
and deterministic with bounded worst case execution times, whereas
file i/o is nasty and unpredictable and NP worst case execution
times.
[1]: This is a very tl;dr discussion worthy of a 90 minute
presentation, but in short yes this is true on all mainstream
operating systems. Linux *can* turn on non-blocking for file handles,
but the feature has "dragons live here" all over it. On Windows an
overlapped file i/o operation can and does go synchronous on many an
occasion - I've seen an overlapped WriteFile() take 1.6 seconds to
return "operation in progress".
Niall
-- Currently unemployed and looking for work. Work Portfolio: http://careers.stackoverflow.com/nialldouglas/
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk