发明授权
- 专利标题: One-time initialization
- 专利标题(中): 一次初始化
-
申请号: US13106836申请日: 2011-05-12
-
公开(公告)号: US09582316B2公开(公告)日: 2017-02-28
- 发明人: Arun Kishan , Neill M Clift
- 申请人: Arun Kishan , Neill M Clift
- 申请人地址: US WA Redmond
- 专利权人: MICROSOFT TECHNOLOGY LICENSING, LLC
- 当前专利权人: MICROSOFT TECHNOLOGY LICENSING, LLC
- 当前专利权人地址: US WA Redmond
- 代理商 Dan Choi; John Jardine; Micky Minhas
- 主分类号: G06F9/46
- IPC分类号: G06F9/46 ; G06F9/48
摘要:
Aspects of the present invention are directed at providing safe and efficient ways for a program to perform a one-time initialization of a data item in a multi-threaded environment. In accordance with one embodiment, a method is provided that allows a program to perform a synchronized initialization of a data item that may be accessed by multiple threads. More specifically, the method includes receiving a request to initialize the data item from a current thread. In response to receiving the request, the method determines whether the current thread is the first thread to attempt to initialize the data item. If the current thread is the first thread to attempt to initialize the data item, the method enforces mutual exclusion and blocks other attempts to initialize the data item made by concurrent threads. Then, the current thread is allowed to execute program code provided by the program to initialize the data item.
公开/授权文献
- US20110219379A1 ONE-TIME INITIALIZATION 公开/授权日:2011-09-08
信息查询