apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Zhakov <i...@visualsvn.com>
Subject Re: Why does apr_file_read() with !APR_XTHREAD use mutexes on Windows
Date Mon, 26 Aug 2013 15:48:59 GMT
On Mon, Aug 26, 2013 at 7:41 PM, William A. Rowe Jr.
<wrowe@rowe-clan.net> wrote:
> On Mon, 26 Aug 2013 18:58:21 +0400
> Ivan Zhakov <ivan@visualsvn.com> wrote:
>> Alternative solution would be take file->lock mutex on write operation
>> and user shared OVERLAPPED structure. Also note that MSDN states that
>> opening file with FILE_APPEND permissions only will perform atomic
>> move-to-end + write without overlapped I/O.
> Sure, that works for files, but apr_file_write is not strictly for
> true file-based handles, right?
Sure, but I think APR_FOPEN_OPEN does makes sense only for files. And
we have file->append flag to check if file opened in append mode.

> Some general thoughts... until apr_file_writev is called, we won't
> need the append file lock.  But... we need to mutex against the
> parallel calls to apr_file_writev so we can't create the mutex to
> interlock at that moment.
Note that this doesn't solve problem with several processes appending
to same file.

Ivan Zhakov

View raw message