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 Mon, 26 Aug 2013 15:41:57 GMT
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?

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.

... we need completion contexts with an event-per-thread ... but
these do not span apr_ calls.  What about parking a per-thread
apr-shared completion context created on apr thread startup and
the event handle closed on apr thread teardown?


Mime
View raw message