设计模式-11-同步型设计模式

上传人:苏**** 文档编号:320158635 上传时间:2022-06-30 格式:PPT 页数:6 大小:16.50KB
返回 下载 相关 举报
设计模式-11-同步型设计模式_第1页
第1页 / 共6页
设计模式-11-同步型设计模式_第2页
第2页 / 共6页
设计模式-11-同步型设计模式_第3页
第3页 / 共6页
设计模式-11-同步型设计模式_第4页
第4页 / 共6页
设计模式-11-同步型设计模式_第5页
第5页 / 共6页
点击查看更多>>
资源描述

《设计模式-11-同步型设计模式》由会员分享,可在线阅读,更多相关《设计模式-11-同步型设计模式(6页珍藏版)》请在金锄头文库上搜索。

1、同步型设计模式同步型设计模式同步型设计模式同步型设计模式常见同步型设计模式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 sco

2、pe, 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

3、 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.

展开阅读全文
相关资源
相关搜索

当前位置:首页 > IT计算机/网络 > 开发文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号