- 专利标题: ONE-TIME INITIALIZATION
-
申请号: US13106836申请日: 2011-05-12
-
公开(公告)号: US20110219379A1公开(公告)日: 2011-09-08
- 发明人: Arun Kishan , Neill M. Clift
- 申请人: Arun Kishan , Neill M. Clift
- 申请人地址: US WA Redmond
- 专利权人: Microsoft Corporation
- 当前专利权人: Microsoft Corporation
- 当前专利权人地址: US WA Redmond
- 主分类号: G06F9/46
- IPC分类号: G06F9/46
摘要:
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.
公开/授权文献
- US09582316B2 One-time initialization 公开/授权日:2017-02-28
信息查询