Check patentability & draft patents in minutes with Patsnap Eureka AI!

Multi-core spin lock design method based on binary calculation

A design method and spin lock technology, applied in computing, program control design, multi-program device, etc., can solve problems such as thread synchronization, and achieve the effect of solving thread synchronization

Active Publication Date: 2021-12-17
BEIJING INST OF COMP TECH & APPL
View PDF9 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] The technical problem to be solved by the present invention is how to provide a multi-core spin lock design method based on binary calculation to solve the thread synchronization problem in Tianyi multi-core multi-thread

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Multi-core spin lock design method based on binary calculation
  • Multi-core spin lock design method based on binary calculation

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0035] In order to make the purpose, content and advantages of the present invention clearer, the specific implementation manners of the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments.

[0036] The invention relates to the protection of shared resources of the system under the multi-core and multi-thread embedded operating system of Tianyi, and is used to solve the thread synchronization problem in the multi-core and multi-thread of Tianyi.

[0037] At any time when the system is running, the spin lock can only have one thread holder at most. If the spin lock is already held, other thread applicants can only enter the loop state and constantly try to obtain the spin lock holding right , until the spin lock holder releases the spin lock, other thread applicants acquire the spin lock in the order in which they try to acquire the spin lock, exit the loop state, and enter the critical protection area to exec...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention relates to a multi-core spin lock design method based on binary calculation, and belongs to the field of thread synchronization. According to the method, two variables, namely, the nextTicket and the ticketInService, are relied on, and the nextTicket and the ticketInService are counted in pairs; when the count value of the nextTicket is smaller than the count value of the ticketInService, it is indicated that the spin lock pLock is not acquired and held by any thread; when the count value of the nextTicket is equal to the count value of the ticketInService, it is indicated that only one thread obtains the spin lock pLock at present, and a critical protection area program of the thread is executed; and when the count value of the nextTicket is larger than the count value of the ticketInService, it is indicated that two or more threads try to obtain the spin lock pLock, a current spin lock holder executes a critical protection area program, and other threads trying to obtain the pLock will spin. According to the method, the system thread can be ensured to access / operate the shared resources according to the sequence of obtaining the spin lock, and the thread synchronization problem in Tianyi multi-core and multi-thread is safely and effectively solved.

Description

technical field [0001] The invention belongs to the field of thread synchronization, and in particular relates to a multi-core spin lock design method based on binary calculation. Background technique [0002] At present, Tianyi embedded operating system has successfully completed the system adaptation to single-core hardware architecture processors such as Arm, Mips, I386 and PowerPC, and has been successfully applied in various model projects. However, when adapting to multi-core processors, different threads under different CPU cores may simultaneously access / share resources in the operating system, resulting in system shared resources that cannot be protected (mutually exclusive access / operation), and system operation exceptions. problems, or even system downtime. [0003] Aiming at the shared resource protection problem encountered in the adaptation of Tianyi embedded operating system to multi-core processors, it is necessary to independently design and implement a loc...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F9/52G06F9/50
CPCG06F9/52G06F9/5016G06F9/5022Y02D10/00
Inventor 徐治纬洪冯李明磊张杨赵晓燕于然
Owner BEIJING INST OF COMP TECH & APPL
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More