apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bert Huijben" <b...@qqmail.nl>
Subject RE: Why does apr_file_read() with !APR_XTHREAD use mutexes on Windows
Date Tue, 27 Apr 2010 09:47:13 GMT

> -----Original Message-----
> From: Jeff Trawick [mailto:trawick@gmail.com]
> Sent: maandag 26 april 2010 23:14
> To: APR Developer List
> Cc: Bert Huijben
> Subject: Re: Why does apr_file_read() with !APR_XTHREAD use mutexes on
> Windows
> On Mon, Apr 26, 2010 at 4:38 PM, William A. Rowe Jr.
> <wrowe@rowe-clan.net> wrote:
> > On 4/26/2010 2:19 PM, Jeff Trawick wrote:
> >>
> >> So I don't think there's any hidden "reason" why a mutex should always
> >> be obtained on Windows.  I too wouldn't be surprised if the fix breaks
> >> some app code somewhere.
> >
> > Keep in mind fd-based operations are atomic on Unix, but not so on
> windows.
> Since these are buffered files, it doesn't even come down to
> differences in OS file operations; operations on the buffer would be
> the expected failure point.
> So the question is whether or not APR expects multi-threaded apps
> sharing a buffered file to turn on the XTHREAD flag.

Another thing I was thinking about is how the append mode is used. I can
imagine that is used to write to a single logfile in a multithreaded
application. (But if we don't enable the mutex on other operating systems,
it should probably be fixed in the application)


View raw message