发明授权
- 专利标题: Reader/writer lock with reduced cache contention
- 专利标题(中): 阅读器/写入器锁减少缓存争用
-
申请号: US12430903申请日: 2009-04-28
-
公开(公告)号: US08145817B2公开(公告)日: 2012-03-27
- 发明人: David L. Detlefs
- 申请人: David L. Detlefs
- 申请人地址: US WA Redmond
- 专利权人: Microsoft Corporation
- 当前专利权人: Microsoft Corporation
- 当前专利权人地址: US WA Redmond
- 代理机构: Boswell IP Law
- 代理商 J. Mason Boswell
- 主分类号: G06F12/00
- IPC分类号: G06F12/00 ; G06F13/00 ; G06F9/46
摘要:
A scalable locking system is described herein that allows processors to access shared data with reduced cache contention to increase parallelism and scalability. The system provides a reader/writer lock implementation that uses randomization and spends extra space to spread possible contention over multiple cache lines. The system avoids updates to a single shared location in acquiring/releasing a read lock by spreading the lock count over multiple sub-counts in multiple cache lines, and hashing thread identifiers to those cache lines. Carefully crafted invariants allow the use of partially lock-free code in the common path of acquisition and release of a read lock. A careful protocol allows the system to reuse space allocated for a read lock for subsequent locking to avoid frequent reallocating of read lock data structures. The system also provides fairness for write-locking threads and uses object pooling techniques to make reduce costs associated with the lock data structures.
公开/授权文献
- US20100275209A1 READER/WRITER LOCK WITH REDUCED CACHE CONTENTION 公开/授权日:2010-10-28
信息查询