A
A n g l e r
Hello there.
What does happen when two threads write to one file opened with
attribute FILE_SHARE_WRITE? Let's that both threads save an array of 10
elements as follows:
THR1: WriteFile(handle1, array1, 10);
THR2: WriteFile(handle2, array2, 10);
where handle1 and handle2 are handles to the same file opened with the
FILE_SHARE_WRITE attribute.
Will these operation cause two arrays will be saved consecutively, or
perhaps will they become completely mixed in a file? Do I have to use a
synchronization like mutex or critical sections, or is this implemented
on the WriteFile level somehow?
Thanks a lot,
Peter.
What does happen when two threads write to one file opened with
attribute FILE_SHARE_WRITE? Let's that both threads save an array of 10
elements as follows:
THR1: WriteFile(handle1, array1, 10);
THR2: WriteFile(handle2, array2, 10);
where handle1 and handle2 are handles to the same file opened with the
FILE_SHARE_WRITE attribute.
Will these operation cause two arrays will be saved consecutively, or
perhaps will they become completely mixed in a file? Do I have to use a
synchronization like mutex or critical sections, or is this implemented
on the WriteFile level somehow?
Thanks a lot,
Peter.