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

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -