Login| Sign Up| Help| Contact|

Patent Searching and Data


Title:
MULTI-THREAD SYNCHRONIZATION METHOD AND ELECTRONIC DEVICE
Document Type and Number:
WIPO Patent Application WO/2021/057643
Kind Code:
A1
Abstract:
A multi-thread synchronization method and an electronic device, wherein same relate to the technical field of terminals. The method comprises: a first thread requesting the acquisition of a target lock. Specifically, a first thread requesting the acquisition of a target lock involves the following steps: the first thread acquiring a lock state variable of the target lock, wherein the lock state variable comprises a lock holding thread identification field and a blocked thread number field; the first thread then checking the lock holding thread identification field; if it is checked and found that the lock holding thread identification field is a valid thread and is not the first thread, the first thread checking the blocked thread number field; if it is checked and found that the blocked thread number field is less than a first threshold value, the first thread performing spin waiting; and when the number of times of spin waiting reaches a second threshold value, if it is checked and found that the lock holding thread identification field is a valid thread and is not the first thread, the first thread adding one to the blocked thread number field, and being suspended from entering a blocked state. The technical solution is conducive to reducing the duration needed for a lock holding thread to access a shared resource, thereby reducing the probability of lagging of an electronic device.

Inventors:
YANG QIBIN (CN)
HUANG SHIYU (CN)
Application Number:
PCT/CN2020/116437
Publication Date:
April 01, 2021
Filing Date:
September 21, 2020
Export Citation:
Click for automatic bibliography generation   Help
Assignee:
HUAWEI TECH CO LTD (CN)
International Classes:
G06F9/52
Foreign References:
CN102566979A2012-07-11
CN1601478A2005-03-30
CN105700939A2016-06-22
US20060288192A12006-12-21
CN111552574A2020-08-18
Other References:
See also references of EP 4020210A4
Attorney, Agent or Firm:
TDIP & PARTNERS (CN)
Download PDF: