发明名称 PREVENTING UNSAFE SHARING THROUGH CONFINEMENT OF MUTABLE CAPTURED VARIABLES
摘要 The disclosed embodiments provide a system that facilitates the development and execution of a software program. During operation, the system provides a mechanism for restricting a variable to a runtime context in the software program. Next, the system identifies the runtime context during execution of the software program. Finally, the system uses the mechanism to prevent incorrect execution of the software program by ensuring that a closure capturing the variable executes within the identified runtime context.
申请公布号 US2014208323(A1) 申请公布日期 2014.07.24
申请号 US201414223492 申请日期 2014.03.24
申请人 Oracle International Corporation 发明人 Goetz Brian;Buckley Alexander R.
分类号 G06F9/46 主分类号 G06F9/46
代理机构 代理人
主权项 1. A computer-implemented method for facilitating the development and execution of a software program, comprising: during execution of the software program: receiving a first context identifier that identifies a creation runtime context and a creation thread that are used to create a closure that captures a variable;receiving a second context identifier that identifies a subsequent-execution runtime context and a subsequent-execution thread for a subsequent execution of the closure; andpreventing unsafe sharing of variables captured by closures by ensuring that the subsequent-execution runtime context corresponds to the creation runtime context by: in response to determining that the first context identifier does not correspond to the second context identifier, preventing the unsafe sharing of variables captured by closures by modifying the closure to execute within the creation thread.
地址 Redwood City CA US