On Mon, Aug 26, 2013 at 7:41 PM, William A. Rowe Jr. <[email protected]> wrote: > On Mon, 26 Aug 2013 18:58:21 +0400 > Ivan Zhakov <[email protected]> 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
