CN113806099B - Binary calculation-based multi-core spin lock design method - Google Patents
Binary calculation-based multi-core spin lock design method Download PDFInfo
- Publication number
- CN113806099B CN113806099B CN202111070598.8A CN202111070598A CN113806099B CN 113806099 B CN113806099 B CN 113806099B CN 202111070598 A CN202111070598 A CN 202111070598A CN 113806099 B CN113806099 B CN 113806099B
- Authority
- CN
- China
- Prior art keywords
- plock
- thread
- spin lock
- ticket
- inservice
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 21
- 238000013461 design Methods 0.000 title claims abstract description 19
- 230000006870 function Effects 0.000 claims description 65
- 230000006978 adaptation Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 239000012792 core layer Substances 0.000 description 1
- 238000012217 deletion Methods 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 239000010410 layer Substances 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/52—Program synchronisation; Mutual exclusion, e.g. by means of semaphores
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5011—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
- G06F9/5016—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5011—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
- G06F9/5022—Mechanisms to release resources
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Executing Machine-Instructions (AREA)
- Storage Device Security (AREA)
Abstract
The invention relates to a multi-core spin lock design method based on binary calculation, and belongs to the field of thread synchronization. The invention relies on two variables, nextTicket and Ticket InService, and the nextTicket and Ticket InService count in pairs; when the nextTicket count value is smaller than the ticket InService count value, the spin lock pLock is not acquired and held by any thread; when the next count value is equal to the ticket tInService count value, the method indicates that only one thread currently acquires the spin lock pLock, and executes the critical protection area program of the thread; when the nextTicket count value is greater than the ticket inservice count value, it indicates that there are two or more threads attempting to acquire the spin lock pLock, the current spin lock holder executes the critical protection zone program, and other threads attempting to acquire the pLock will spin. The method can ensure that the system threads access/operate the shared resources according to the sequence of acquiring the spin locks, and safely and effectively solve the problem of thread synchronization in the day bright multi-core multi-thread.
Description
Technical Field
The invention belongs to the field of thread synchronization, and particularly relates to a multi-core spin lock design method based on binary calculation.
Background
Currently, the day bright embedded operating system has successfully completed system adaptation to Arm, mips, I386 and single core hardware architecture processors such as PowerPC, and successfully applied to multi-model projects. However, when the multi-core processor is oriented to the adaptation, the phenomenon that different threads under different CPU cores access/operate shared resources in the system simultaneously exists, so that the shared resources of the system cannot be safely protected (mutually exclusive access/operation), the problem of abnormal system operation occurs, and even the system is down.
Aiming at the problem of shared resource protection encountered when the embedded operating system of the day bright is adapted to the multi-core processor, a set of locking mechanism-spin lock embedded into the kernel layer of the day bright system needs to be designed and realized autonomously.
Disclosure of Invention
First, the technical problem to be solved
The invention aims to provide a binary calculation-based multi-core spin lock design method to solve the problem of thread synchronization in the day bright multi-core multi-thread.
(II) technical scheme
In order to solve the technical problems, the invention provides a multi-core spin lock design method based on binary calculation, which is realized by counting two variables, namely, two member variables, namely, nextTicket and Ticket InService, of a spin lock pLock, wherein the nextTicket is a count value of the spin lock which is tried to be obtained by a certain thread on a certain CPU core, the Ticket InService is a count value of the spin lock released after a currently held thread of the spin lock pLock executes a critical protection area program, and the nextTicket and the Ticket InService are counted in pairs;
1) When the nextTicket count value is smaller than the ticket InService count value, the spin lock pLock is not acquired and held by any thread;
2) When the next count value is equal to the ticket tInService count value, the method indicates that only one thread currently acquires the spin lock pLock, and executes the critical protection area program of the thread;
3) When the nextTicket count value is greater than the ticket inservice count value, it indicates that there are two or more threads attempting to acquire the spin lock pLock, the current spin lock holder executes the critical protection zone program, and other threads attempting to acquire the pLock will spin.
Further, the spin lock design method includes 4 interface functions, namely initializing the interface functions for the spin lock, acquiring the spin lock interface functions, releasing the spin lock interface functions and deleting the spin lock interface functions.
Further, spin lock initialization interface function spinLockTaskInit () applies spin lock pLock object memory space, instantiates it according to default properties, and initializes the member variables nextTicket and Ticket InService values of spin lock pLock to 0.
Further, acquiring spin lock interface function spinLockTaskTake (), adding 1 to a member variable nextTicket value of pLock, and assigning the member variable nextTicket value to a local variable my_tick in the function; then, a member variable Ticket InService of the pLock is obtained and assigned to a local variable non_serving in the function; and finally, entering a loop to judge whether the non-pulling is equal to the my-pulling, if so, exiting the loop to continue execution of the current thread, and if not, obtaining a value of the ticket Inservice in the loop body and assigning the value to the non-pulling until the my-pulling is equal to the non-pulling, and exiting the loop body to continue execution.
Further, releasing the spinlockTaskGive () function increments the member variable, ticketInService, of pLock by 1.
Further, delete spin lock interface function spinlockTaskDestroy () deletes spin lock pLock and frees up memory space it occupies.
Further, interrupts are disabled and opened before and after execution of the acquire and release spin lock function.
Further, the method is applied to the day bright embedded operating system.
The invention also provides a multi-core spin lock design method based on binary computation, wherein an embedded operating system runs on a 4-core processor, a main thread M runs on a 0-core, and other 3 sub threads A, B, C respectively run on 1, 2 and 3 cores;
step one, initializing a spin lock after the system is started:
when the initialization is started, the main thread M calls a function spinLockTaskInit () to complete initializing pLock, then calls the function spinLockTaskGive () to release pLock for the first time, at the moment, the pLock is in an acquirable state, the value of the next Ticket is 0, the value of the Ticket InService is 1, and the next Ticket is smaller than the Ticket InService;
step two, a thread of a certain core acquires a spin lock pLock for the first time:
the thread A calls a function spinLockTaskTake () to firstly acquire pLock, adds 1 to a member variable, assigns the member variable to my_tick, wherein the time value is 1, the non_service is assigned as the tickInservice, the time value is 1, the non_service is equal to my_tick, the thread A exits the loop, and enters a critical protection area to execute a protected code segment;
step three, before the thread A releases the pLock, other threads acquire the pLock:
when the thread A executes the critical protection area program, pLock is not released, at the moment, the thread B calls a function spinLockTaskTake () to acquire a spin lock pLock, a member variable, namely a next Ticket, is added with 1 and assigned to my_tick, the time value is 2, the non_service is assigned as a ticket_InService, the time value is 1, the non_service is not equal to my_tick, and the thread B enters a loop body and is in a spin state;
if the 3-core thread C also acquires pLock after the thread B, adding 1 to a member variable nextTicket and assigning the member variable nextTicket to the my_tick, wherein the time value is 3, the non_serving is assigned as the tick_InService, the time value is 1, the non_serving is not equal to the my_tick, and the thread C enters the loop body and is in a spin state;
step four, thread A completes the critical protection zone program, and successfully releases pLock:
the thread A executes the critical protection area program of pLock protection, calls a function spinLockTaskGive () to release pLock, and adds 1 to the member variable Ticket InService value; at this time, thread B and thread C both acquire the value of the Ticket InService, the time value is 2, and the value is assigned to the non_service, so that the condition that thread B exits from the loop body is met, thread B preferentially exits from the loop execution critical protection zone program, and thread C is still in a spin state;
when the thread B completes the execution of the critical protection area program, a function spinLockTaskGive () is called to successfully release pLock, the value of a member variable Ticket InService is added with 1, the time value is 3, the thread C acquires the value of Ticket InService and assigns the value to non_serving, the time value is 3, the condition that the thread C exits from a loop body is met, the thread C exits from the loop to execute the critical protection area program, then the function spinLockTaskGive () is called to release pLock, the value of the pLock member variable Ticket InService is added with 1, the time value is 4, and the nextTicket count value is smaller than the Ticket InService count value;
step five, deleting the spin lock pLock:
when the user ensures that the pLock is not required to be used, the function spinLockTaskDestroy () is called to delete the spin lock pLock, and the occupied memory space is released.
Further, shared resources under a multi-core system are accessed or operated by only one thread of one core at any time of system operation.
(III) beneficial effects
The invention provides a multi-core spin lock design method based on binary calculation, which achieves the purpose of protecting shared resources of a system by releasing and acquiring counts of corresponding member variables and real-time comparison of values of two variables during spin lock. The spin lock control module designed by the invention can ensure that the system threads access/operate the shared resources according to the sequence of acquiring the spin locks, and safely and effectively solve the thread synchronization problem in the multi-core multi-thread of day bright.
Drawings
FIG. 1 is a schematic diagram of the design principle of a multi-core spin lock based on binary computation.
Detailed Description
To make the objects, contents and advantages of the present invention more apparent, the following detailed description of the present invention will be given with reference to the accompanying drawings and examples.
The invention relates to protection of system shared resources under multi-core and multi-thread of a day bright embedded operating system, which is used for solving the problem of thread synchronization in multi-core and multi-thread of a day bright.
At any time of system operation, spin lock can only have one thread holder at most, if spin lock has already been held, then other thread requesters can only enter a circulation state, and continuously try to acquire spin lock holding right until spin lock holders release spin lock, and other thread requesters acquire spin lock according to the sequence of attempting to acquire spin lock, exit the circulation state and enter a critical protection zone-removal execution program.
The invention designs and realizes a set of spin lock control modules embedded into the inner core layer of the Tian bright system. The core design interfaces of the spin lock module are divided into 4, and the core design interfaces are respectively: spin lock initialization (creation) of interface functions, acquisition of spin lock interface functions, release of spin lock interface functions, and deletion of spin lock interface functions, the detailed design interface names are shown in table 1.
Table 1 spin lock module interface function list
The lock mechanism of the spin lock control module is realized by counting two variables (binary values), wherein the variables refer to two member variables nextTicket and ticket service of the spin lock pLock, the nextTicket means that a certain thread on a certain CPU core tries to acquire the count value of the spin lock pLock, and the ticket service means that the currently held thread of the spin lock pLock releases the count value of the spin lock after executing the critical protection zone program. The nextTicket counts in pairs with the ticket inservice:
1) When the nextTicket count value is smaller than the ticket InService count value, the spin lock pLock is not acquired and held by any thread;
2) When the next count value is equal to the ticket tInService count value, the fact that only one thread acquires the spin lock pLock at present is indicated, and the critical protection area program of the thread can be executed;
3) When the nextTicket count value is greater than the ticket inservice count value, it indicates that there are two or more threads attempting to acquire the lock pLock, the current lock holder may execute the critical protection zone program, and other threads attempting to acquire the lock will spin.
The function of the 4 core interface functions of the spin lock control module is described as follows:
1) Spin lock initialization (creation) of interface functions
The spinLockTaskInit () is used for applying for the memory space of the spin lock pLock object, initializing the spin lock pLock object according to default attribute, and initializing the member variables nextTicket and Ticket InService value to be 0.
2) Acquisition of spin lock interface functions
The spinLockTaskTake () has the main functions that a member variable nextTicket value of pLock is added with 1, and the value is assigned to a local variable my_tick in the function; then, a member variable Ticket InService of the pLock is obtained and assigned to a local variable non_serving in the function; finally, entering a loop to judge whether the non-pulling is equal to the my_pulling, if so, exiting the loop to continue execution of the current thread, and if not, obtaining a value of the ticket Inservice in the loop body and assigning the value to the non-pulling until the my_pulling is equal to the non-pulling, and exiting the loop body to continue execution.
3) Releasing spin lock interface functions
The spinlocktaskgire () main function is to add 1 to the member variable ticketservice value of pLock.
4) Deleting spin lock interface functions
The main function of the spinLockTaskDestroy () is to delete the spin lock pLock and free the memory space it occupies.
The protection purpose of the shared resource of the system is achieved by releasing and acquiring the count of the corresponding member variable and the real-time comparison of the numerical values of the two variables when the spin lock is released. Disabling and opening interrupts is required before and after the execution of the acquire and release spin lock function.
In order to make the technical solution and advantages of the present invention more clear, the following detailed description will be given with reference to the accompanying drawings and the steps of the pseudo code execution flow.
Assuming that the day bright embedded operating system runs on a 4-core processor of the i386 platform, the main thread M runs on a 0-core, and after the other 3 sub-threads A, B, C are set to affinity (binding core processing), the main thread M runs on 1, 2 and 3 cores respectively.
Step one, initializing a spin lock after the system is started:
when the system is initialized and started on day bright, the main thread M calls a function spinLockTaskInit () to complete initialization of pLock, then calls the function spinLockTaskGive () to release pLock for the first time, at this time, the pLock is in an acquirable state, the value of the nextTicket is 0, the value of the Ticket InService is 1, and the value of the nextTicket is smaller than the Ticket InService.
Step two, a thread of a certain core acquires a spin lock pLock for the first time:
assuming that the thread a calls the function spinLockTaskTake () to first acquire plck, add 1 to the member variable, nextTicket, and assign a value to my_tick (this value is 1), now_service is assigned to a ticklnservice (this value is 1), the while (now_service |=my_tick) loop condition is not satisfied, now_service equals my_tick, thread a exits the loop, and enters the critical protection zone to execute the protected code segment.
Step three, before the thread A releases the pLock, other threads acquire the pLock:
when the thread A executes the critical protection area program, pLock is not released, at this time, the 2-core thread B calls a function spinLockTaskTake () to acquire a spin lock pLock, a member variable, namely, a next Ticket, is added with 1 and assigned to my_tick (the value is 2 at this time), no_service is assigned to be Ticket Inservice (the value is 1), a while (no_service =my_tick) circulation condition is satisfied, no_service is not equal to my_tick, and the thread B enters a circulation body (in a spin state).
If the 3-core thread C also acquires pllock after the thread B at this time, the member variable nextTicket is added with 1 and assigned to my_tick (this value is 3), now_service is assigned to tick_service (this value is 1), the while (now_service |=my_tick) loop condition is satisfied, now_service is not equal to my_tick, and the thread C enters the loop body (in spin state). Similarly, the spin lock mechanism successfully ensures that shared resources under the multi-core system can only be accessed/operated by one thread of one core at any time of system operation.
Step four, thread A completes the critical protection zone program, and successfully releases pLock:
the 1-core thread A executes the critical protection area program of pLock protection, calls a function spinLockTaskGive () to release pLock, and adds 1 to the member variable Ticket InService value. At this time, the thread B and the thread C both acquire the value of the Ticket tInService (the value is 2 at this time) and assign the value to the non_service, so as to meet the condition that the thread B exits from the loop body, and the thread B preferentially exits from the loop execution critical protection zone program, and the thread C is still in a spin state.
When thread B completes the critical protection zone program, the function spinLockTaskGive () is called to successfully release pLock, the value of the member variable Ticket InService is added with 1 (the time value is 3), thread C obtains the value of Ticket InService and assigns to non_service (the time value is 3), the condition that thread C exits the loop body is met, thread C exits the loop execution critical protection zone program, then the function spinLockTaskGive () is called to release pLock, the value of the pLock member variable Ticket InService is added with 1 (the time value is 4), and the nextTicket count value is smaller than the Ticket InService count value.
Step five, deleting the spin lock pLock:
when the user ensures that the pLock is not required to be used, the function spinLockTaskDestroy () can be called to delete the spin lock pLock, and the occupied memory space is released.
The spin lock control module designed by the invention can ensure that the system threads access/operate the shared resources according to the sequence of acquiring the spin locks, and safely and effectively solve the thread synchronization problem in the multi-core multi-thread of day bright.
The foregoing is merely a preferred embodiment of the present invention, and it should be noted that modifications and variations could be made by those skilled in the art without departing from the technical principles of the present invention, and such modifications and variations should also be regarded as being within the scope of the invention.
Claims (5)
1. The method is characterized by being realized by counting two variables, namely, two member variables of a spin lock pLock, namely, a nextTicket and a Ticket InService, wherein the nextTicket is a count value of the spin lock pLock attempted to be obtained by a certain thread on a certain CPU core, the Ticket InService is a count value of the spin lock released after the currently held thread of the spin lock pLock executes a critical protection area program, and the nextTicket and the Ticket InService are counted in pairs;
1) When the nextTicket count value is smaller than the ticket InService count value, the spin lock pLock is not acquired and held by any thread;
2) When the next count value is equal to the ticket tInService count value, the method indicates that only one thread currently acquires the spin lock pLock, and executes the critical protection area program of the thread;
3) When the next count value is greater than the ticket InService count value, it means that there are more than two threads attempting to acquire the spin lock pLock, the current spin lock holder executes the critical protection zone program, and other threads attempting to acquire the pLock will spin;
wherein,,
the spin lock design method comprises 4 interface functions, namely initializing the interface functions for the spin lock, acquiring spin lock interface functions, releasing the spin lock interface functions and deleting the spin lock interface functions;
the spin lock initialization interface function spinLockTaskInit () applies for the memory space of the spin lock pLock object, initializes the spin lock pLock object according to default attribute, and initializes the member variables nextTicket and Ticket InService value of the spin lock pLock to 0;
obtaining spin lock interface function spinLockTaskTake () to add 1 to the member variable nextTicket value of pLock and assign to the local variable my_tick in the function; then, a member variable Ticket InService of the pLock is obtained and assigned to a local variable non_serving in the function; finally, entering a loop to judge whether the non-pulling is equal to the my-pulling, if so, exiting the loop to continue execution of the current thread, and if not, obtaining a ticket Inservice value in the loop body and assigning the ticket Inservice value to the non-pulling until the my-pulling is equal to the non-pulling, and exiting the loop body to continue execution;
releasing spin lock interface function spinLockTaskGive () to add 1 to the member variable Ticket InService value of pLock;
deleting spin lock interface function spinlocktaskDestroy () deletes spin lock pLock and frees up memory space it occupies.
2. The binary computation-based multi-core spin lock design method of claim 1, wherein interrupts are disabled and opened before and after execution of the acquire and release spin lock function.
3. The binary computation-based multi-core spin lock design method of claim 1, wherein the method is applied to a day bright embedded operating system.
4. The design method of the multi-core spin lock based on binary computation is characterized in that an embedded operating system runs on a 4-core processor, a main thread M runs on a 0-core, and other 3 sub threads A, B, C run on 1, 2 and 3 cores respectively;
step one, initializing a spin lock after the system is started:
when the initialization is started, the main thread M calls a function spinLockTaskInit () to complete initializing pLock, then calls the function spinLockTaskGive () to release pLock for the first time, at the moment, the pLock is in an acquirable state, the value of the next Ticket is 0, the value of the Ticket InService is 1, and the next Ticket is smaller than the Ticket InService;
step two, a thread of a certain core acquires a spin lock pLock for the first time:
the thread A calls a function spinLockTaskTake () to firstly acquire pLock, adds 1 to a member variable, assigns the member variable to my_tick, wherein the time value is 1, the non_service is assigned as the tickInservice, the time value is 1, the non_service is equal to my_tick, the thread A exits the loop, and enters a critical protection area to execute a protected code segment;
step three, before the thread A releases the pLock, other threads acquire the pLock:
when the thread A executes the critical protection area program, pLock is not released, at the moment, the thread B calls a function spinLockTaskTake () to acquire a spin lock pLock, a member variable, namely a next Ticket, is added with 1 and assigned to my_tick, the time value is 2, the non_service is assigned as a ticket_InService, the time value is 1, the non_service is not equal to my_tick, and the thread B enters a loop body and is in a spin state;
if the 3-core thread C also acquires pLock after the thread B, adding 1 to a member variable nextTicket and assigning the member variable nextTicket to the my_tick, wherein the time value is 3, the non_serving is assigned as the tick_InService, the time value is 1, the non_serving is not equal to the my_tick, and the thread C enters the loop body and is in a spin state;
step four, thread A completes the critical protection zone program, and successfully releases pLock:
the thread A executes the critical protection area program of pLock protection, calls a function spinLockTaskGive () to release pLock, and adds 1 to the member variable Ticket InService value; at this time, thread B and thread C both acquire the value of the Ticket InService, the time value is 2, and the value is assigned to the non_service, so that the condition that thread B exits from the loop body is met, thread B preferentially exits from the loop execution critical protection zone program, and thread C is still in a spin state;
when the thread B completes the execution of the critical protection area program, a function spinLockTaskGive () is called to successfully release pLock, the value of a member variable Ticket InService is added with 1, the time value is 3, the thread C acquires the value of Ticket InService and assigns the value to non_serving, the time value is 3, the condition that the thread C exits from a loop body is met, the thread C exits from the loop to execute the critical protection area program, then the function spinLockTaskGive () is called to release pLock, the value of the pLock member variable Ticket InService is added with 1, the time value is 4, and the nextTicket count value is smaller than the Ticket InService count value;
step five, deleting the spin lock pLock:
when the user ensures that the pLock is not required to be used, the function spinLockTaskDestroy () is called to delete the spin lock pLock, and the occupied memory space is released.
5. The binary computation-based multi-core spin lock design method of claim 4, wherein shared resources under a multi-core system are accessed or operated by only one thread of one core at any time of system operation.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111070598.8A CN113806099B (en) | 2021-09-13 | 2021-09-13 | Binary calculation-based multi-core spin lock design method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111070598.8A CN113806099B (en) | 2021-09-13 | 2021-09-13 | Binary calculation-based multi-core spin lock design method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113806099A CN113806099A (en) | 2021-12-17 |
CN113806099B true CN113806099B (en) | 2023-07-28 |
Family
ID=78941118
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111070598.8A Active CN113806099B (en) | 2021-09-13 | 2021-09-13 | Binary calculation-based multi-core spin lock design method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113806099B (en) |
Family Cites Families (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103473135B (en) * | 2013-09-23 | 2016-08-24 | 中国科学技术大学苏州研究院 | The processing method of spin lock LHP phenomenon under virtualized environment |
US9940269B2 (en) * | 2016-01-22 | 2018-04-10 | International Business Machines Corporation | Conditionally releasing locks in response to requests |
US11226852B2 (en) * | 2016-11-25 | 2022-01-18 | Genetec Inc. | System for inter-process communication |
CN108108244B (en) * | 2017-12-15 | 2021-09-28 | 中南大学 | Slope intensity reduction coefficient multi-thread parallel computing method |
CN109101313A (en) * | 2018-03-15 | 2018-12-28 | 山东超越数控电子股份有限公司 | A kind of realization and test method of real-time kernel |
CN108446181A (en) * | 2018-03-26 | 2018-08-24 | 武汉斗鱼网络科技有限公司 | The method, apparatus and terminal device access resource constraint |
CN112306699B (en) * | 2019-07-29 | 2024-04-12 | 华为技术有限公司 | Method and device for accessing critical resources, computer equipment and readable storage medium |
US11150945B2 (en) * | 2019-09-04 | 2021-10-19 | Red Hat, Inc. | Reverse restartable sequences for lock polling scalability |
CN111984428A (en) * | 2020-07-20 | 2020-11-24 | 上海金仕达软件科技有限公司 | Method, device and equipment for realizing spin lock during resource access |
-
2021
- 2021-09-13 CN CN202111070598.8A patent/CN113806099B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN113806099A (en) | 2021-12-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6253225B1 (en) | Process executing method and resource accessing method in computer system | |
US7698540B2 (en) | Dynamic hardware multithreading and partitioned hardware multithreading | |
US6173442B1 (en) | Busy-wait-free synchronization | |
US8789057B2 (en) | System and method for reducing serialization in transactional memory using gang release of blocked threads | |
US20240345901A1 (en) | Generic concurrency restriction | |
US9471399B2 (en) | Orderable locks for disclaimable locks | |
Drepper | Futexes are tricky | |
CN103473135B (en) | The processing method of spin lock LHP phenomenon under virtualized environment | |
JPH1115793A (en) | Protection method for resource maintainability | |
US8495642B2 (en) | Mechanism for priority inheritance for read/write locks | |
WO2019006997A1 (en) | Program deadlock detection method, storage medium, device and system | |
CN113806099B (en) | Binary calculation-based multi-core spin lock design method | |
CN108345505B (en) | Multithreading resource management method and system | |
CN111984428A (en) | Method, device and equipment for realizing spin lock during resource access | |
JP2010504581A (en) | Robust critical section design in multithreaded applications | |
US20160320984A1 (en) | Information processing device, parallel processing program and method for accessing shared memory | |
US9081630B2 (en) | Hardware-implemented semaphore for resource access based on presence of a memory buffer in a memory pool | |
CN111989651A (en) | Method and device for managing kernel service in multi-core system | |
Kim et al. | Perfecting preemption threshold scheduling for object-oriented real-time system design: From the perspective of real-time synchronization | |
CN113961364A (en) | Large-scale lock system implementation method and device, storage medium and server | |
US12079657B2 (en) | Handling ownership of process threads | |
JPH07319716A (en) | Exclusive control system for resources of computer system | |
US12039363B2 (en) | Synchronizing concurrent tasks using interrupt deferral instructions | |
CN114327828B (en) | Lock-free concurrent access method, device, equipment and medium for shared data | |
Dimitoglou | Deadlocks and methods for their detection, prevention and recovery in modern operating systems |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |