c# - Synchronize writing to a file at file-system level -
i have text file , multiple threads/processes write (it's log file).
the file gets corrupted because of concurrent writings.
i want use file writing mode of threads sequential @ file-system level itself.
i know it's possible use locks (mutex multiple processes) , synchronize writing file prefer open file in correct mode , leave task system.io
.
is possible ? what's best practice scenario ?
your best bet use locks/mutexex. it's simple approach, works , can understand , reason it.
when comes synchronization pays start simplest solution work , try refine if hit problems.
Comments
Post a Comment