Invention Application
- Patent Title: Method And Apparatus For Accessing Critical Resource, Computer Device, And Readable Storage Medium
-
Application No.: US17587663Application Date: 2022-01-28
-
Publication No.: US20220147404A1Publication Date: 2022-05-12
- Inventor: Chengguang ZHENG , Minqi ZHOU , Tong YUAN
- Applicant: HUAWEI TECHNOLOGIES CO., LTD.
- Applicant Address: CN Shenzhen
- Assignee: HUAWEI TECHNOLOGIES CO., LTD.
- Current Assignee: HUAWEI TECHNOLOGIES CO., LTD.
- Current Assignee Address: CN Shenzhen
- Priority: CN201910690999.X 20190729
- Main IPC: G06F9/52
- IPC: G06F9/52 ; G06F9/50 ; G06F9/48

Abstract:
A method and an apparatus for accessing a critical resource, a computer device, and a readable storage medium are provided, to help reduce a quantity of operations for contending for a lock by a thread, and computing resources, and improve performance of an ARM processor. The method for accessing a critical resource includes: selecting a first thread from the first thread and a second thread to contend for a target lock (201), where a first task to be executed by the first thread and a second task to be executed by the second thread correspond to the target lock; and if the first thread obtains the target lock through contention, enabling the first thread to execute the first task, and replace the second thread to execute the second task (202).
Information query