US 12,379,872 B2
Program detection method and apparatus
Rutao Zhang, Shanghai (CN); and Qing Zhou, Beijing (CN)
Assigned to HUAWEI TECHNOLOGIES CO., LTD., Shenzhen (CN)
Filed by Huawei Technologies Co., Ltd., Shenzhen (CN)
Filed on Jun. 27, 2023, as Appl. No. 18/342,388.
Application 18/342,388 is a continuation of application No. PCT/CN2021/123936, filed on Oct. 14, 2021.
Claims priority of application No. 202011608587.6 (CN), filed on Dec. 29, 2020.
Prior Publication US 2023/0367516 A1, Nov. 16, 2023
Int. Cl. G06F 3/06 (2006.01); G06F 8/41 (2018.01); G06F 9/46 (2006.01); G06F 11/362 (2025.01)
CPC G06F 3/0659 (2013.01) [G06F 3/0604 (2013.01); G06F 3/0673 (2013.01); G06F 8/433 (2013.01); G06F 9/467 (2013.01); G06F 11/3632 (2013.01)] 20 Claims
OG exemplary drawing
 
1. A program detection method, comprising:
receiving, from a user, a program running in a weak memory environment;
calculating a first interval between a first operation in a first thread of the program and a second operation in the first thread, and a second interval between a third operation in a second thread of the program and a fourth operation in the second thread, wherein the first operation and the third operation are a first pair of read and write operations performed on a first variable, wherein the second operation and the fourth operation are a second pair of read and write operations performed on a second variable, wherein the first operation and the second operation are operations performed on different variables, and wherein the third operation and the fourth operation are operations performed on different variables; and
obtaining, based on a query parameter, the first interval, the second interval, and the program, a result of the program,
wherein the query parameter indicates a maximum interval between two operations on which reordering occurs and that are of the program.