apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe Jr." <wr...@rowe-clan.net>
Subject Re: Why does apr_file_read() with !APR_XTHREAD use mutexes on Windows
Date Fri, 23 Aug 2013 23:48:23 GMT
On Fri, 23 Aug 2013 18:39:35 -0500
"William A. Rowe Jr." <wrowe@rowe-clan.net> wrote:

> On Sat, 24 Aug 2013 00:33:38 +0400
> Ivan Zhakov <ivan@visualsvn.com> wrote:
> 
> > Actually Windows supports atomic seek-to-end+write: file should be
> > opened with FILE_APPEND_DATA access right only [1] or Offset and
> > OffsetHigh should be 0xFFFFFFFF if overlapped I/O is used [2].
> > 
> > I'm reopening this thread because in Subversion we found case where
> > we need true atomic append across processes/threads. So I'm willing
> > to create a patch implementing atomic append on Windows. Is right
> > idea for APR or not? Any concerns will be very helpful.
> > 
> > [1]
> > http://msdn.microsoft.com/en-us/library/windows/desktop/aa363778%28v=vs.85%29.aspx
> > [2]
> > http://msdn.microsoft.com/en-us/library/windows/desktop/aa365747%28v=vs.85%29.aspx
> 
> IIRC the difference is that you have writev on unix to atomically 
> write multiple buffers.  On Windows we fake writev, so your proposed
> atomic writes are no longer atomic.

Now we might use WriteFileGather at this point (remember, this stuff
was all written when Server 2000 was still around :)... but note that
the compatibility is listed as "Windows Server 2003 [Desktop apps only].
WTF would that mean?  Also not supported for 32 bit Itanium apps running
under WOW64.  How bizarre.  Then read the description of the
aSegmentArray arg to really break your brain.





Mime
View raw message