WriteFile thread safety

后端 未结 1 944
南方客
南方客 2021-01-23 06:29

Is WriteFile thread safe? I mean,can I write the same file from multiple threads simultaneously without synchronization? MSDN says nothing about thread safety of WriteFile.

相关标签:
1条回答
  • 2021-01-23 07:24

    Yes it is thread safe by its own, i.e it prevents system from crashing, win API maintain internal locking when writing files and that lock is byte-range locks. You can read more here File locking

    0 讨论(0)
提交回复
热议问题