Subject: Re: [boost] Serialisation: Is is_trivial<T> a sufficient precondition to bypass serialisation?
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2015-02-06 07:20:12
On 6 Feb 2015 at 11:07, Mathias Gaunard wrote:
> > As with network sockets, most DMA engines for disk i/o have hard
> > limits on scatter gather buffer size. That isn't AFIO's problem.
> So if I try to write a std::vector that is too large to fit in a
> scatter/gather buffer, my write will fail?
AFIO observes the IOV_MAX batch limit, so on POSIX with pwritev()
support no it should never fail, though of course you lose atomicity
between IOV_MAX batches. On POSIX without pwritev() support AFIO
issues each buffer singly anyway, so your atomicity is per buffer.
On Windows if buffered i/o is on then there is no limit and atomicity
is per buffer (Windows has no scatter gather file i/o functions for
buffered files). If buffered i/o is off, the WriteFileGather() API
currently has an unofficial limit of 32Mb on x64 operating systems
due to NT kernel structure limits. Because this limit is not
documented and not stable even across 32 bit vs 64 bit systems never
mind between Intel and ARM, AFIO passes through your request as-is,
and returns an error if the WriteFileGather() API does.
-- ned Productions Limited Consulting http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk