CN113961364A - Large-scale lock system implementation method and device, storage medium and server - Google Patents

Large-scale lock system implementation method and device, storage medium and server Download PDF

Info

Publication number
CN113961364A
CN113961364A CN202111189055.8A CN202111189055A CN113961364A CN 113961364 A CN113961364 A CN 113961364A CN 202111189055 A CN202111189055 A CN 202111189055A CN 113961364 A CN113961364 A CN 113961364A
Authority
CN
China
Prior art keywords
lock
application program
request
calling interface
executed
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.)
Pending
Application number
CN202111189055.8A
Other languages
Chinese (zh)
Inventor
何清
禹力杰
王毅
王奕飞
谢贝贝
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xian Thermal Power Research Institute Co Ltd
Xian TPRI Power Station Information Technology Co Ltd
Original Assignee
Xian Thermal Power Research Institute Co Ltd
Xian TPRI Power Station Information Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Xian Thermal Power Research Institute Co Ltd, Xian TPRI Power Station Information Technology Co Ltd filed Critical Xian Thermal Power Research Institute Co Ltd
Priority to CN202111189055.8A priority Critical patent/CN113961364A/en
Publication of CN113961364A publication Critical patent/CN113961364A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals

Abstract

A large-scale lock system implementation method, a device, a storage medium and a server comprises the steps that an application program calls an application program calling interface of a software module, a lock pool management object is initialized, and the application program calling interface receives an access request and transfers to a lock pool management layer to implement service; the application program calls an application program calling interface of the software module to create a logic lock object for the object needing lock protection, and the application program calling interface receives the access request and transfers the access request to a logic lock management layer to realize service; the application program calls the application program calling interface of the software module, executes the locking process and the unlocking process, and transfers to the logic locking operation layer to realize corresponding service. As more than million-level objects need thread security, the system can be prevented from being stressed by excessive locks. If the critical section lock is used on a large scale, due to the fact that multithreading competition continuously occurs, the multithreading safety function can be completed by using only few critical section locks.

Description

Large-scale lock system implementation method and device, storage medium and server
Technical Field
The invention relates to the field of large-scale resource object thread safety protection, in particular to a large-scale lock system implementation method, device, storage medium and server.
Background
The lock is an important resource provided by a multitask operating system, and is commonly in various forms such as a critical region, a semaphore, a mutex and the like, and the core function of the lock is that in the field of parallel program design, when two or more threads face the possibility of simultaneously accessing a certain resource (the same variable, the same memory block, the same Socket handle, the same IO handle and the like), in order to avoid read-write collision, exclusive protection needs to be performed on the read-write operations, and when a certain thread operates the resource, other threads are in a waiting state.
In the field of large-scale server development, due to the need of multi-thread and large concurrent parallel access on resources such as large-scale variables, memory objects, handle objects and the like, the high-density resource access can ensure the integrity and safety of data access and the efficiency of resource access only by needing high-efficiency and massive lock resource support. However, the number of locks allowed to be held by each process is limited, and a large amount of lock resources are used, so that handle resources and memory resources of the system are consumed in a large scale, the performance of the service process is seriously affected, and even the operating system is crashed due to insufficient resources. Therefore, in server applications using lock resources on a large scale, the problem can be solved by the following methods:
1. the protection range of the lock is improved, the occupation of the lock handle is reduced, and a lock is used for protecting a complete data structure, such as an array, a queue or a linked list. This occupies little operating system resources, but can result in too dense lock collisions during large concurrent accesses, most threads consume a lot of time to preempt the lock, and the access efficiency is very low.
2. The spin lock is used for providing independent lock protection for the data resource, and because the spin lock works in a user state and does not occupy handle resources and memory resources of an operating system, the condition of insufficient system resources is avoided. However, the large-scale use of spin locks can occupy a large amount of CPU resources, and especially for some operations which are complex and time-consuming, the use of spin locks can seriously affect the performance of the server.
3. The locking and unlocking states of the data resources are registered by using a state table, so that the data resource lock protection is realized, wherein the state table is generally realized by using a Hash table or a Bit-map table. The design method is largely used in the row lock of the database, can effectively reduce the lock conflict under the condition of not occupying too much operating system resources, and can improve the performance of the server to a certain extent. However, in this design scheme, the lock state of the resource needs to be obtained by looking up the table, which has a certain influence on the performance, and meanwhile, when the thread seizes the lock resource, the thread runs in the user state as a spin lock, which has the same defect as the spin lock, and it is difficult to balance the CPU occupation and the CPU utilization.
The three schemes are not perfect, either the performance is low or the resource waste is serious, the two schemes are difficult to compromise, and the lock protection requirement aiming at mass data, which not only considers the performance but also occupies a small amount of resources in the field of large servers, is difficult to meet.
Disclosure of Invention
The present invention aims to solve the above problems in the prior art, and provide a method, an apparatus, a storage medium, and a server for implementing a large-scale lock system, which can use few operating system resources (physical lock resources, memory, etc.), and provide large-scale lock resources for an application layer to implement an efficient "small lock" application model, thereby meeting the high-performance development requirements in a multitasking environment.
In order to achieve the purpose, the invention has the following technical scheme:
in a first aspect, an embodiment of the present invention provides a method for implementing a large-scale lock system, including the following steps:
the application program calls an application program calling interface of the software module to initialize a lock pool management object, and the application program calling interface receives an access request and transfers the access request to a lock pool management layer to realize service;
the application program calls an application program calling interface of the software module to create a logic lock object for the object needing lock protection, and the application program calling interface receives the access request and transfers the access request to a logic lock management layer to realize service;
an application program calls an application program calling interface of the software module to prepare for holding a lock, the application program calling interface receives an access request and transfers the access request to a logic lock operation layer to realize service, if the request is a critical area lock, lock () operation is executed, if the request is a read lock of a read-write lock, rdlock () operation is executed, and if the request is a write lock, wrlock () operation is executed;
the application program calls an application program calling interface of the software module to prepare for releasing the holding lock, the application program calling interface receives an access request and transfers the access request to a logic lock operation layer to realize service, unlock () operation is executed if the request is a critical section lock, rdunlock () operation is executed if the request is a read lock of a read-write lock, and wrunnlock () operation is executed if the request is a write lock.
As a preferred scheme of the large-scale lock system implementation method, the operation steps are completed under the protection of the same system physical lock, so that the operation steps are not interrupted in the execution process.
As a preferred solution of the implementation method of the large-scale lock system of the present invention, the lock () operation execution condition is that multiple threads access the same resource simultaneously.
As a preferred solution of the implementation method of the large-scale lock system of the present invention, the lock () operation execution step includes: after a locking requirement is put forward for the first time, a lock pool interface is called to create a global lock pool, and a plurality of idle locks are stored in the global lock pool to wait for use; after receiving the locking task, the lock pool judges whether the resource initiates a locking request for the first time, if the resource initiates the locking request for the first time, the lock pool actively allocates a free lock to the resource, adds one to the reference count value of the lock, and then performs locking operation; if the locking request is not initiated for the first time, the lock pool will not allocate a new free lock to the request, and only on the basis of the original lock of the resource, the reference count value is increased by one to indicate that the object is being used by multiple parties.
As a preferred scheme of the implementation method of the large-scale lock system, the unlock () operation execution condition is that the current thread finishes using the resources.
As a preferred solution of the implementation method of the large-scale lock system of the present invention, the unlock () operation execution step includes: subtracting 1 from the reference count value of the lock occupied by the resource, and judging by using the value and 1; if the number is more than 1, other threads have the requirement of locking the resource, and no processing is missed; if the number of the resource is equal to 1, the requirement of the resource is temporarily not preempted, and when the requirement of the resource is not preempted, the resource is returned to the lock pool to wait for the next locking requirement.
In a second aspect, an embodiment of the present invention further provides a large-scale lock system implementation apparatus, including:
the initialization module is used for calling an application program calling interface of the software module by an application program, initializing a lock pool management object, receiving an access request by the application program calling interface, and transferring to a lock pool management layer to realize service;
the logic lock creation module is used for calling an application program calling interface of the software module by an application program, creating a logic lock object for an object needing lock protection, receiving an access request by the application program calling interface, and transferring to a logic lock management layer to realize service;
the locking module is used for calling an application program calling interface of the software module by an application program to prepare for holding a lock, the application program calling interface receives an access request and transfers the access request to a logic lock operation layer to realize service, if the request is a critical area lock, lock () operation is executed, if the request is a read lock of a read-write lock, rdlock () operation is executed, and if the request is a write lock, wrlock () operation is executed;
and the unlocking module is used for calling the application program calling interface of the software module by the application program to prepare for releasing the holding lock, the application program calling interface receives the access request and transfers the access request to the logic lock operation layer to realize service, unlock () operation is executed if the request is a critical section lock, rdunlock () operation is executed if the request is a read lock of a read-write lock, and wrunlock () operation is executed if the request is a write lock.
In a third aspect, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the implementation method of the large-scale lock system is implemented.
In a fourth aspect, an embodiment of the present invention further provides a server, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the implementation method of the large-scale lock system when executing the computer program.
Compared with the prior art, the invention has the following beneficial effects: the number of threads of a server process is limited, and is a few threads, and a large number of threads is only about a few hundred threads, so that the server thread can only use a few hundred lock objects at most when the server does not have thread conflict at most. Even if the lock resources are used in a server process on a large scale, the number of the lock resources which are accessed at the same time is always small, and other large number of lock resources are in an idle state, which is really a great waste of system resources. If the server process can be recovered and reused in time like the system memory resource, the purpose of using few lock resources and realizing large-scale lock application can be achieved. As more than million-level objects need thread security, the system can be prevented from being stressed by excessive locks. If a critical section lock is used on a large scale, Event handles are continuously created as multi-thread contention continues to occur, and a process may not run if it exceeds the number of handles of 16M. When the large-scale lock system designed by the invention is used, the multi-thread safety function can be completed by using few critical section locks.
Drawings
FIG. 1 is a schematic diagram of a large-scale lock system constructed according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a locking process of a large-scale locking system implementation method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of an unlocking process of a large-scale locking system implementation method according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. In addition, it should be noted that, for convenience of description, only a part of structures related to the present invention, not all of the structures, are shown in the drawings.
As an implementation of large-scale lock systems, the most important of them is the scheduling and utilization of lock resources, i.e. the process in which locking and unlocking are performed.
Referring to fig. 1, in the large-scale lock system structure constructed by the present invention, an API interface is directly called by an application program without relation to internal logic, a plurality of logical locks are stored in a logical lock management layer, locks in a lock pool are taken by the logical locks, and the lock pool management layer interacts with the logical lock management layer to implement the operation of taking the locks in the lock pool.
Calling an interface by an application program: the operation method is used for defining the module, and other computer programming languages are called to realize function output;
and (4) locking the pool management layer: the system is used for providing a lock resource recovery and distribution algorithm logic based on a pool and realizing the reuse of the lock resource;
the logic lock management layer: for defining a logical lock object, which is not a true lock, but a logical lock management object, which stores an object pointer and reference counter of a true lock. The logical lock management layer provides a create (), destroy () operation method for creating and releasing logical lock objects;
the logical lock operation layer: for providing lock algorithm logic, each lock implemented provides the operating characteristics of the corresponding lock type, such as lock (), unlock (), trylock () operations for critical section locks, and rdlock (), rdunlock (), wrlock (), wrunlock (), etc.
The invention provides a large-scale lock system implementation method, which comprises the following steps:
the application program calls an application program calling interface of the software module to initialize a lock pool management object, and the application program calling interface receives an access request and transfers the access request to a lock pool management layer to realize service;
the application program calls an application program calling interface of the software module to create a logic lock object for the object needing lock protection, and the application program calling interface receives the access request and transfers the access request to a logic lock management layer to realize service;
an application program calls an application program calling interface of the software module to prepare for holding a lock, the application program calling interface receives an access request and transfers the access request to a logic lock operation layer to realize service, if the request is a critical area lock, lock () operation is executed, if the request is a read lock of a read-write lock, rdlock () operation is executed, and if the request is a write lock, wrlock () operation is executed;
the application program calls an application program calling interface of the software module to prepare for releasing the holding lock, the application program calling interface receives an access request and transfers the access request to a logic lock operation layer to realize service, unlock () operation is executed if the request is a critical section lock, rdunlock () operation is executed if the request is a read lock of a read-write lock, and wrunnlock () operation is executed if the request is a write lock.
All actions are completed under the protection of the same system physical lock, so that all actions are not interrupted during operation, and the multithreading safety of the software module is ensured.
Referring to fig. 2, the lock () operation execution condition is that multiple threads access the same resource at the same time, and is a complaint proposed to ensure the integrity, reliability, and security of data. When multiple persons operate the same data in the database at the same time, if the same data is contended by multiple persons under the condition of no locking, the final integrity and reliability of the data cannot be ensured, and hidden danger is caused to the use safety of the subsequent data. The lock () operation executing step comprises: after a locking requirement is put forward for the first time, a lock pool interface is called to create a global lock pool, and a plurality of idle locks are stored in the global lock pool to wait for use; after receiving the locking task, the lock pool judges whether the resource initiates a locking request for the first time, if the resource initiates the locking request for the first time, the lock pool actively allocates a free lock to the resource, adds one to the reference count value of the lock, and then performs locking operation; if the locking request is not initiated for the first time, the lock pool will not allocate a new free lock to the request, and only on the basis of the original lock of the resource, the reference count value is increased by one to indicate that the object is being used by multiple parties.
Referring to fig. 3, the unlock () operation execution condition is that the current thread has finished using the resource, and the appeal proposed for ensuring other threads to normally access and process the resource is provided. The unlock () operation executing step comprises: subtracting 1 from the reference count value of the lock occupied by the resource, and judging by using the value and 1; if the number is more than 1, other threads have the requirement of locking the resource, and no processing is missed; if the number of the resource is equal to 1, the requirement of the resource is temporarily not preempted, and when the requirement of the resource is not preempted, the resource is returned to the lock pool to wait for the next locking requirement.
Another embodiment of the present invention further provides a large-scale lock system implementation apparatus, including:
the initialization module is used for calling an application program calling interface of the software module by an application program, initializing a lock pool management object, receiving an access request by the application program calling interface, and transferring to a lock pool management layer to realize service;
the logic lock creation module is used for calling an application program calling interface of the software module by an application program, creating a logic lock object for an object needing lock protection, receiving an access request by the application program calling interface, and transferring to a logic lock management layer to realize service;
the locking module is used for calling an application program calling interface of the software module by an application program to prepare for holding a lock, the application program calling interface receives an access request and transfers the access request to a logic lock operation layer to realize service, if the request is a critical area lock, lock () operation is executed, if the request is a read lock of a read-write lock, rdlock () operation is executed, and if the request is a write lock, wrlock () operation is executed;
and the unlocking module is used for calling the application program calling interface of the software module by the application program to prepare for releasing the holding lock, the application program calling interface receives the access request and transfers the access request to the logic lock operation layer to realize service, unlock () operation is executed if the request is a critical section lock, rdunlock () operation is executed if the request is a read lock of a read-write lock, and wrunlock () operation is executed if the request is a write lock.
Another embodiment of the present invention further provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the method for implementing a large-scale lock system.
Another embodiment of the present invention further provides a server, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the method for implementing the large-scale lock system when executing the computer program.
Illustratively, the computer program may be divided into one or more modules/units, which are stored in a computer-readable storage medium and executed by the processor to perform the steps of the method of implementing a large-scale lock system described herein. The one or more modules/units may be a series of computer-readable instruction segments capable of performing certain functions, which are used to describe the execution of the computer program in the server.
The server can be a computing device such as a smart phone, a notebook, a palm computer and a cloud server. The server may include, but is not limited to, a processor, a memory. It will be appreciated by those skilled in the art that the server may also include more or fewer components, or some components in combination, or different components, e.g., the server may also include input output devices, network access devices, buses, etc.
The Processor may be a CentraL Processing Unit (CPU), other general purpose Processor, a DigitaL SignaL Processor (DSP), an AppLication Specific Integrated Circuit (ASIC), an off-the-shelf ProgrammabLe Gate Array (FPGA) or other ProgrammabLe logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage may be an internal storage unit of the server, such as a hard disk or a memory of the server. The memory may also be an external storage device of the server, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure DigitaL (SD) Card, a FLash memory Card (FLash Card), or the like provided on the server. Further, the memory may also include both an internal storage unit of the server and an external storage device. The memory is used to store the computer readable instructions and other programs and data needed by the server. The memory may also be used to temporarily store data that has been output or is to be output.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the method embodiment, and specific reference may be made to the part of the method embodiment, which is not described herein again.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium and can implement the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a photographing apparatus/terminal apparatus, a recording medium, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), an electrical carrier signal, a telecommunications signal, and a software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (9)

1. A large-scale lock system implementation method is characterized by comprising the following steps:
the application program calls an application program calling interface of the software module to initialize a lock pool management object, and the application program calling interface receives an access request and transfers the access request to a lock pool management layer to realize service;
the application program calls an application program calling interface of the software module to create a logic lock object for the object needing lock protection, and the application program calling interface receives the access request and transfers the access request to a logic lock management layer to realize service;
an application program calls an application program calling interface of the software module to prepare for holding a lock, the application program calling interface receives an access request and transfers the access request to a logic lock operation layer to realize service, if the request is a critical area lock, lock () operation is executed, if the request is a read lock of a read-write lock, rdlock () operation is executed, and if the request is a write lock, wrlock () operation is executed;
the application program calls an application program calling interface of the software module to prepare for releasing the holding lock, the application program calling interface receives an access request and transfers the access request to a logic lock operation layer to realize service, unlock () operation is executed if the request is a critical section lock, rdunlock () operation is executed if the request is a read lock of a read-write lock, and wrunnlock () operation is executed if the request is a write lock.
2. The mass locking system implementation method of claim 1, wherein: the operation steps are completed under the protection of the same system physical lock, so that the operation steps are not interrupted in the execution process.
3. The mass locking system implementation method of claim 1, wherein: the lock () operation is executed under the condition that a plurality of threads access the same resource at the same time.
4. The method for implementing a mass locking system according to claim 1, wherein the lock () operation executing step comprises: after a locking requirement is put forward for the first time, a lock pool interface is called to create a global lock pool, and a plurality of idle locks are stored in the global lock pool to wait for use; after receiving the locking task, the lock pool judges whether the resource initiates a locking request for the first time, if the resource initiates the locking request for the first time, the lock pool actively allocates a free lock to the resource, adds one to the reference count value of the lock, and then performs locking operation; if the locking request is not initiated for the first time, the lock pool will not allocate a new free lock to the request, and only on the basis of the original lock of the resource, the reference count value is increased by one to indicate that the object is being used by multiple parties.
5. The mass locking system implementation method of claim 1, wherein: the unlock () operation execution condition is that the current thread finishes using the resources.
6. The method for implementing the large-scale lock system according to claim 1, wherein the unlock () operation executing step comprises: subtracting 1 from the reference count value of the lock occupied by the resource, and judging by using the value and 1; if the number is more than 1, other threads have the requirement of locking the resource, and no processing is missed; if the number of the resource is equal to 1, the requirement of the resource is temporarily not preempted, and when the requirement of the resource is not preempted, the resource is returned to the lock pool to wait for the next locking requirement.
7. A mass locking system implementation apparatus, comprising:
the initialization module is used for calling an application program calling interface of the software module by an application program, initializing a lock pool management object, receiving an access request by the application program calling interface, and transferring to a lock pool management layer to realize service;
the logic lock creation module is used for calling an application program calling interface of the software module by an application program, creating a logic lock object for an object needing lock protection, receiving an access request by the application program calling interface, and transferring to a logic lock management layer to realize service;
the locking module is used for calling an application program calling interface of the software module by an application program to prepare for holding a lock, the application program calling interface receives an access request and transfers the access request to a logic lock operation layer to realize service, if the request is a critical area lock, lock () operation is executed, if the request is a read lock of a read-write lock, rdlock () operation is executed, and if the request is a write lock, wrlock () operation is executed;
and the unlocking module is used for calling the application program calling interface of the software module by the application program to prepare for releasing the holding lock, the application program calling interface receives the access request and transfers the access request to the logic lock operation layer to realize service, unlock () operation is executed if the request is a critical section lock, rdunlock () operation is executed if the request is a read lock of a read-write lock, and wrunlock () operation is executed if the request is a write lock.
8. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, implements a mass lock system implementation method according to any one of claims 1 to 6.
9. A server comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the mass lock system implementation method as claimed in any one of claims 1 to 6 when executing the computer program.
CN202111189055.8A 2021-10-12 2021-10-12 Large-scale lock system implementation method and device, storage medium and server Pending CN113961364A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111189055.8A CN113961364A (en) 2021-10-12 2021-10-12 Large-scale lock system implementation method and device, storage medium and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111189055.8A CN113961364A (en) 2021-10-12 2021-10-12 Large-scale lock system implementation method and device, storage medium and server

Publications (1)

Publication Number Publication Date
CN113961364A true CN113961364A (en) 2022-01-21

Family

ID=79463689

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111189055.8A Pending CN113961364A (en) 2021-10-12 2021-10-12 Large-scale lock system implementation method and device, storage medium and server

Country Status (1)

Country Link
CN (1) CN113961364A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114528113A (en) * 2022-04-24 2022-05-24 广州中望龙腾软件股份有限公司 Thread lock management system, method, equipment and readable medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114528113A (en) * 2022-04-24 2022-05-24 广州中望龙腾软件股份有限公司 Thread lock management system, method, equipment and readable medium
CN114528113B (en) * 2022-04-24 2022-08-23 广州中望龙腾软件股份有限公司 Thread lock management system, method, equipment and readable medium

Similar Documents

Publication Publication Date Title
US8381230B2 (en) Message passing with queues and channels
CN108572876B (en) Method and device for realizing read-write lock
EP3230860B1 (en) Technologies for efficient synchronization barriers with work stealing support
CN113205417B (en) Alliance chain oriented transaction parallel processing method and system
CN111857993B (en) Method for calling user mode function in kernel mode
US20080201712A1 (en) Method and System for Concurrent Message Processing
CN107562685B (en) Method for data interaction between multi-core processor cores based on delay compensation
US10248471B2 (en) Lockless execution in read-mostly workloads for efficient concurrent process execution on shared resources
CN115509986A (en) Inter-core communication method, electronic device, and storage medium
CN113010265A (en) Pod scheduling method, scheduler, memory plug-in and system
CN114168271A (en) Task scheduling method, electronic device and storage medium
US10360079B2 (en) Architecture and services supporting reconfigurable synchronization in a multiprocessing system
US8543722B2 (en) Message passing with queues and channels
US20080243887A1 (en) Exclusion control
CN113961364A (en) Large-scale lock system implementation method and device, storage medium and server
US9250977B2 (en) Tiered locking of resources
JP7346649B2 (en) Synchronous control system and method
CN109558241A (en) A kind of method and device obtaining spin lock
CN112346879B (en) Process management method, device, computer equipment and storage medium
CN113254506A (en) Data processing method and device, computer equipment and storage medium
US9619277B2 (en) Computer with plurality of processors sharing process queue, and process dispatch processing method
CN113778674A (en) Lock-free implementation method of load balancing equipment configuration management under multi-core
CN111814007B (en) Method, device and equipment for processing data of doubly-linked list and machine-readable storage medium
CN117112246B (en) Control device of spin lock
CN113126968B (en) Task execution method, device, electronic equipment and storage medium

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