user2260241
user2260241

Reputation: 95

WriteFile thread safety

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

Answers (1)

Nasir Mahmood
Nasir Mahmood

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

Related Questions