资源预览内容
第1页 / 共6页
第2页 / 共6页
第3页 / 共6页
第4页 / 共6页
第5页 / 共6页
第6页 / 共6页
亲,该文档总共6页全部预览完了,如果喜欢就下载吧!
资源描述
同步型设计模式同步型设计模式同步型设计模式同步型设计模式常见同步型设计模式Scoped Lock设计模式Strategized Locking设计模式Thread-Safe Interface 设计模式Double-Checked Locking Optimization设计模式Scoped Lock设计模式设计模式The Scoped Locking C+ idiom ensures that a lock is acquired when control enters a scopeand released automatically when control leaves the scope, regardless of the return path fromthe scope.Strategized Locking设计模式设计模式The Strategized Locking design pattern parameterizes synchronization mechanisms thatprotect a components critical sections from concurrent access.Thread-Safe InterfaceThe Thread-Safe Interface design pattern minimizes locking overhead and ensures thatintra-component method calls do not incur self-deadlock by trying to reacquire a lock that isheld by the component already.Double-Checked Locking OptimizationThe Double-Checked Locking Optimization design pattern reduces contention andsynchronization overhead whenever critical sections of code must acquire locks in a threadsafemanner just once during program execution.
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号