MFC提供许多类别,这些类别允许执行绪同步物件的存取,以维护执行绪安全性。
MFC provides a number of classes that allow threads to synchronize access to objects to maintain thread safety.
列举值没有集合的独占存取权,因此,列举一个集合在本质上并不是执行绪安全的程序。
The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure.
将锁定的使用限制在只用于必须完整执行的程序码,您就能够写入确保资料安全的多执行绪元件,同时还是能够保持良好效能。
Restricting your locks only to code that must be executed atomically will allow you to write multithreaded components that ensure the safety of your data while still maintaining good performance.
应用推荐