WriteFile线程安全 [英] WriteFile thread safety
本文介绍了WriteFile线程安全的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
是的,它是线程安全的,但它自己的,即它防止系统崩溃,赢写入文件时,API保持内部锁定,并且锁定是字节范围锁定。更多你可以阅读这个
文件锁定
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.
解决方案
Yes it is thread safe but its own i.e it prevent system from crashing, win API maintain internal locking when writing files and that lock is byte-range locks. more you can read this File locking
这篇关于WriteFile线程安全的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文