Reputation: 95
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.
Upvotes: 3
Views: 2357
Reputation: 1505
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
Upvotes: 3