WO2024255500A1 - 一种多线程并发管理方法和相关装置 - Google Patents
一种多线程并发管理方法和相关装置 Download PDFInfo
- Publication number
- WO2024255500A1 WO2024255500A1 PCT/CN2024/092938 CN2024092938W WO2024255500A1 WO 2024255500 A1 WO2024255500 A1 WO 2024255500A1 CN 2024092938 W CN2024092938 W CN 2024092938W WO 2024255500 A1 WO2024255500 A1 WO 2024255500A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- thread
- target
- variable
- sub
- bit
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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/466—Transaction processing
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; 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
Definitions
- the present application relates to the field of computer technology, and in particular to a multi-threaded concurrent management method and related devices.
- a thread is a single sequential control flow in a process and is the smallest unit of program execution.
- threads are used as the basic unit of independent operation and scheduling. Threads can be executed concurrently, including concurrent execution of multiple threads in a process, concurrent execution of threads in different processes, and concurrent execution of threads on different cores in a multi-core computer system.
- CAS compare and switch
- a common application scenario for CAS operations is in read-write locks or other functions that implement similar read-write functions (such as pinbuffer/unpinbuffer). Read-write locks have two states: read lock and write lock.
- Read-write locks generally use a variable for state control, and consistency can be ensured between multiple threads through CAS operations.
- the embodiments of the present application provide a multi-thread concurrent management method and related devices, which are applied in the scenario of multi-thread concurrent CAS operation and can improve the success rate of CAS operation.
- an embodiment of the present application provides a multi-threaded concurrency management method, which may include: dividing a target global variable into multiple sub-variable areas; the target global variable is used to control multi-threaded access to target data, and each of the multiple sub-variable areas includes one or more flag bits; dividing multiple threads into multiple thread groups; the multiple threads are used to apply for permission to read the target data; authorizing a target thread in a target thread group to modify the flag bit in a target sub-variable area; wherein the target thread group is one of the multiple thread groups, the target sub-variable area is one of the multiple sub-variable areas, and one of the thread groups and one of the multiple sub-variable areas correspond one to one; if the target thread successfully modifies the flag bit, the target thread is allowed to read the target data.
- the multiple threads applying to read the shared data are divided into multiple thread groups, so that one thread group corresponds to one sub-variable area, and different thread groups correspond to different sub-variable areas, so that when threads in different thread groups apply to read shared data, they can obtain the permission to read the shared data by modifying the value of the corresponding sub-variable area.
- the modification of the values of different sub-variable areas between threads of different thread groups is independent, so that the value of each sub-variable area can be successfully modified by one thread respectively, that is, in one round of concurrent modification, multiple threads can be successfully modified.
- the method further includes: determining the total number of threads that can currently read the target data according to the state of the mark bit in each sub-variable area.
- the number of threads that can currently read the shared data represented by each sub-variable area is determined according to the state of the flag bit in each sub-variable area, and the total number of threads that can currently read the shared data is the sum of the number of threads that can be determined in each sub-variable area.
- the lock will fail and the thread will go into hibernation and wait.
- the thread that previously applied for a write lock and temporarily went into hibernation can be awakened.
- one thread in the target thread group is allowed to successfully modify the mark bit in the target sub-variable area.
- the authorizing a target thread in a target thread group to modify a flag bit in a target subvariable area includes:
- the target thread in the target thread group is authorized to modify the flag bit in the target sub-variable area through a compare and exchange (CAS) operation.
- CAS compare and exchange
- the thread during the process of modifying the mark bit of the sub-variable area by a thread, it can first be determined whether the target data has been exclusively occupied. If no other thread has exclusively occupied the target data, the thread can modify the mark bit through a CAS operation to ensure the consistency of the modification and avoid confusion.
- each sub-variable area further includes a control status bit, and the control status bit is used to indicate whether the target data is exclusively occupied; and the method further includes:
- the first thread If the first thread successfully modifies the control status bit, the first thread is allowed to exclusively occupy the target data.
- each sub-variable area may also have a control status bit, and the control status bit may be used to identify whether the target data has been exclusively occupied by a thread.
- the thread needs to modify the control status bit in each sub-variable area, so that when other threads subsequently apply to read the target data, they only need to determine whether the target data is exclusively occupied by judging the control status bit in the sub-variable area corresponding to their own thread group. If the thread applying for exclusive use of the target data successfully modifies the control status bit, the thread is allowed to exclusively occupy the target data.
- the step of authorizing the first thread to modify the control status bit of each sub-variable area includes:
- the first thread is authorized to modify the control status bit of each sub-variable area through a CAS operation.
- the thread can modify the control status bit of each sub-variable area through a CAS operation to ensure the consistency of the modification and avoid confusion when multiple threads apply for exclusive use of the target data at the same time.
- the global variable is a lock state variable
- the mark bit is a read lock count bit
- the threads in the multiple thread groups modify the mark bit in the sub-variable area to add a read lock or an unread lock.
- the method of controlling multi-threaded access to shared data can be a read-write lock
- the global variable can be a lock state variable
- the mark bit can be a read lock count bit
- the process of multiple threads applying to read the target data and modifying the mark bit is equivalent to the encryption and unencryption lock operation.
- the lock state variable is partitioned, the threads are grouped, and multiple threads can modify the read lock count bit of the partition in multiple parallel ways, multiple threads can modify successfully, thereby improving the success rate of encryption and unencryption lock.
- the global variable is a lock state variable
- the control state bit is a write lock state bit
- the threads in the multiple thread groups modify the control state bit in the sub-variable area to add a write lock or release a write lock.
- the method of controlling multi-threaded access to shared data can be a read-write lock
- the global variable can be a lock state variable
- the control state bit can be a write lock state bit
- the process of multiple threads applying for exclusive use of the target data and modifying the write lock state bit is equivalent to adding and unlocking the write lock operation.
- an embodiment of the present application provides a multi-threaded concurrency management device, which may include: a first processing unit, configured to divide a target global variable into a plurality of sub-variable areas; the target global variable is used to control multi-threaded access to target data, each of the plurality of sub-variable areas comprising one or more flag bits;
- a second processing unit is used to divide the multiple threads into multiple thread groups; the multiple threads are used to apply for permission to read the target data;
- Target thread group is one of the multiple thread groups
- target sub-variable region is one of the multiple sub-variable regions
- one of the multiple thread groups and one of the multiple sub-variable regions correspond to each other one by one
- the third processing unit is configured to allow the target thread to read the target data if the target thread successfully modifies the mark bit.
- the device further includes:
- a determination unit is used to determine the total number of threads that can currently read the target data according to the state of the mark bit in each sub-variable area.
- one thread in the target thread group is allowed to successfully modify the mark bit in the target sub-variable area.
- the second processing unit is specifically configured to:
- the target thread in the target thread group is authorized to modify the flag bit in the target sub-variable area through a compare and exchange (CAS) operation.
- CAS compare and exchange
- each of the sub-variable regions further includes a control status bit, and the control status bit is used to indicate whether the target data is exclusively occupied;
- the second processing unit is further used to authorize the first thread of the target thread group to modify the control status bit of each sub-variable region respectively when the first thread applies for exclusive use of the target data;
- the third processing unit is further configured to allow the first thread to exclusively occupy the target data if the first thread successfully modifies the control status bit.
- the second processing unit is specifically configured to:
- the first thread is authorized to modify the control status bit of each sub-variable area through a CAS operation.
- the global variable is a lock state variable
- the mark bit is a read lock count bit
- the threads in the multiple thread groups modify the mark bit in the sub-variable area to add a read lock or an unread lock.
- the global variable is a lock state variable
- the control state bit is a write lock state bit
- the threads in the multiple thread groups modify the control state bit in the sub-variable area to add a write lock or release a write lock.
- an embodiment of the present application provides a multi-threaded concurrent management device, including a processor, the processor being configured to support the device to implement the corresponding functions in the multi-threaded concurrent management method provided in the first aspect.
- the device may also include a memory, the memory is used to couple with the processor, and the memory stores the necessary program instructions and data of the device.
- the device may also include an interface circuit for the device to communicate with other devices, other equipment or a communication network.
- an embodiment of the present application provides a computer-readable storage medium for storing computer software instructions used by a device apparatus for implementing a multi-threaded concurrent management method provided by one or more of the second aspects above, which includes a program designed for executing the above aspects.
- an embodiment of the present application provides a computer program, which includes instructions.
- the computer program When the computer program is executed by a computer, the computer can execute a process executed by an apparatus for implementing a multi-threaded concurrent management method provided by one or more of the second aspects above.
- an embodiment of the present application provides an electronic device, the electronic device includes a processor, and the processor is configured to support the electronic device to implement the corresponding functions in the multi-threaded concurrent management method provided in the first aspect.
- the electronic device may also include a memory, the memory is used to couple with the processor, and the memory stores the necessary program instructions and data of the electronic device.
- the electronic device may also include a communication interface for enabling the electronic device to communicate with other devices or a communication network.
- an embodiment of the present application provides a chip system, which includes a processor for supporting a device to implement the functions involved in the first aspect, for example, generating or processing the information involved in the multi-threaded concurrent management method.
- the chip system also includes a memory, which is used to store program instructions and data necessary for the device.
- the chip system can be composed of a chip, or it can include a chip and other discrete devices.
- an embodiment of the present application provides a server, including a communication interface, a memory, and a processor; the communication interface, the memory, and the processor are coupled, the communication interface is used for the server to communicate with other devices or a communication network, and the memory is used to store computer program code.
- the computer program code includes computer instructions.
- an embodiment of the present application provides a vehicle-mounted device, including a communication interface, a memory and a processor; the communication interface, the memory and the processor are coupled, the communication interface is used for the vehicle-mounted device to communicate with other devices or a communication network, the memory is used to store computer program code, the computer program code includes computer instructions, and when the processor reads the computer instructions from the memory, the vehicle-mounted device executes any possible implementation method as in the first aspect.
- FIG1 is a schematic diagram of the structure of a lock state variable
- FIG2 is a schematic diagram of a read-write lock process
- FIG3 is a schematic diagram of the result of a multi-threaded CAS operation performed simultaneously
- FIG4 is a schematic diagram of a system architecture of a multi-threaded concurrent management method application provided in an embodiment of the present application
- FIG5 is a flow chart of a multi-threaded concurrent management method provided in an embodiment of the present application.
- FIG6 is a schematic diagram of the structure of a lock state variable partition provided in an embodiment of the present application.
- FIG7 is a schematic diagram of a result of a multi-thread group performing CAS operations simultaneously provided by an embodiment of the present application
- FIG8 is a performance analysis perf flame graph provided in an embodiment of the present application.
- FIG9 is another performance analysis perf flame graph provided in an embodiment of the present application.
- FIG10 is another performance analysis perf flame graph provided in an embodiment of the present application.
- FIG11 is a schematic diagram of the structure of a multi-threaded concurrent management device provided in an embodiment of the present application.
- FIG. 12 is a schematic diagram of the structure of another multi-threaded concurrent management device provided in an embodiment of the present application.
- a component can be, but is not limited to, a process running on a processor, a processor, an object, an executable file, an execution thread, a program and/or a computer.
- applications running on a computing device and a computing device can be components.
- One or more components may reside in a process and/or an execution thread, and a component may be located on a computer and/or distributed between two or more computers.
- these components may be executed from various computer-readable media having various data structures stored thereon.
- Components may, for example, communicate through local and/or remote processes based on signals having one or more data packets (e.g., data from two components interacting with another component between a local system, a distributed system and/or a network, such as the Internet interacting with other systems through signals).
- signals having one or more data packets (e.g., data from two components interacting with another component between a local system, a distributed system and/or a network, such as the Internet interacting with other systems through signals).
- Atomic operation refers to one or a series of operations that cannot be interrupted, that is, operations that will not be interrupted by the thread scheduling mechanism, and there will be no context switch during operation.
- Atomic operations mainly include simple addition and subtraction operations, compare and exchange (CAS) operations, and assignment operations.
- CAS compare and exchange
- the variable is divided into multiple regions, and multiple threads are grouped.
- the count value of the corresponding target region in the variable can be modified through a CAS operation. That is, by dividing the CAS operations of concurrent threads into multiple regions, the concurrency conflicts of CAS operations are reduced, thereby improving the success rate of CAS operations.
- Read-write locks including read locks and write locks. Among them, only one thread can occupy the read-write lock in the write lock state at a time, but multiple threads can occupy the read-write lock in the read lock state at the same time. Therefore, when the read-write lock is in the write lock state, all threads attempting to lock the lock (including read lock and write lock) will be blocked before the lock is unlocked. When the read-write lock is in the read lock state, other threads attempting to add the read lock can obtain access rights, but if a thread wants to add the write lock, it must wait until all threads release the lock.
- the read-write lock generally uses a variable for state control, and the consistency between multiple threads can be guaranteed through CAS operations.
- the variable used to control the state of the read-write lock can be partitioned, and multiple threads with concurrent CAS operations can be grouped.
- the count value of the corresponding target area in the variable can be modified through the CAS operation, and other areas are used to process concurrent CAS operations of threads in other groups, thereby improving the success rate of CAS.
- the compare and switch (CAS) operation will pass in three values: the address of the target variable to be modified, the original value of the variable, and the new value to be modified.
- memory access will be exclusively controlled in certain units (usually within a cache line). If the value of the target variable in the memory (target variable address) is equal to the "original value of the variable” passed in by the CAS operation, the target variable in the memory will be changed to the "new value to be modified” passed in by the CAS operation; if the value of the target variable in the memory is inconsistent with the "original value of the variable” passed in by the CAS operation, the modification fails and the current value of the target variable is transmitted. This ensures the atomicity of the target variable value modification in multi-threaded concurrent scenarios.
- Concurrency means that multiple threads can run part of the logic in a period of time. The current thread can start executing regardless of whether the previous thread has completed, without having to wait for the previous thread to complete.
- plural means two or more.
- “and/or” describes the association relationship of related objects, indicating that three relationships can exist.
- a and/or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
- the character “/” generally indicates that the related objects are in an "or” relationship.
- Solution 1 The common implementation of the read-write lock is to control it through a lock state variable, see Figure 1, which is a schematic diagram of the structure of a lock state variable. Taking Linux rwlock as an example, the variable shown in Figure 1 indicates that no thread currently holds the write lock, and 3 threads hold the read lock. When the variable is 0, it means that the read-write lock is in an idle state, that is, no thread holds the lock (including the read lock and the write lock). When the highest bit is 1, it means that a thread holds the write lock, and the highest bit is set to 0 when the thread releases the write lock.
- each thread is synchronized through CAS operation instructions to ensure that only one thread can modify the variable at a time.
- the write lock status bit does not have to be in the highest bit, or not all bits in the variable are used for read-write lock counting. Several bits can be used for other customized identification purposes.
- Figure 2 is a schematic diagram of the process of adding read-write locks.
- a thread applies for a write lock (such as method 1 in Figure 2)
- the lock state is first judged to see whether it is a read lock or a write lock. If it has been locked, then the application for the write lock fails and needs to be reapplied (it can be retried immediately or waited to be awakened by other release processes); if it has not been locked, then the variable write lock state position needs to be set to 1, and then the CAS atomic operation is performed on the variable.
- the write lock is added successfully; if the modification fails, it means that other threads have locked and modified the variable value first during this period, and the write lock fails, and enters the retry, wait or other processes.
- a thread applies for a read lock (such as method 2 in Figure 2)
- the lock state is first judged to see whether it is a write lock. If a write lock has been added, the read lock application fails and needs to be reapplied (you can retry immediately or wait to be awakened by other release processes); if a write lock has not been added, the variable read lock count bit needs to be increased by 1, and then the CAS atomic operation is performed on the variable.
- the read lock is successfully added; if the modification fails, it means that other threads have modified the variable value during this period, that is, when multiple threads concurrently add read locks, other threads successfully add read locks, resulting in the failure of this thread to add read locks, and enter retry or other processes. Under normal circumstances, the read lock process will be retried immediately according to the latest value of the current lock state variable.
- Figure 3 is a schematic diagram of the results of multiple threads performing CAS operations simultaneously. Taking 4 threads adding read locks at the same time as an example, the current value is read from the memory that stores the lock state variable, and the old value and the new value are the input values of the CAS operation.
- each CAS operation In the four rounds of concurrent CAS operations, there are 4 valid CAS operations (ie OK), and 6 invalid CAS operations (ie failed). That is, the number of successful CAS operations is 4, and the number of failed operations is 6 (3 in the first round, 2 in the second round, and 1 in the third round).
- the overhead of each CAS operation is relatively large, and it also requires synchronous memory access between multiple cores and across slices, occupying memory bandwidth and computing resources.
- Solution 2 Other functions that implement similar read and write functions (such as pinbuffer/unpinbuffer) control the sharing, exclusivity, and other status identification of data pages.
- sharing uses a sharing count, which is similar to adding a read lock and unreading a read lock.
- Pinbuffer can be simply understood as adding a read lock
- unpinbuffer can be simply understood as an unreading lock.
- Kunpeng 2P+openGauss open source Gauss
- the present application proposes a multi-threaded concurrent management method and related devices, which are applied in the scenario of multi-threaded concurrent CAS operations, and can improve the success rate of CAS operations.
- the global variables of shared data are divided into multiple areas, and the multiple threads that apply to read the shared data are divided into multiple thread groups, one thread group corresponds to one variable area, and different thread groups correspond to different variable areas, so that when threads in different thread groups apply to read shared data, they can obtain the permission to read the shared data by modifying the value of the corresponding variable area.
- the modification of the values of different variable areas between threads in different thread groups is independent, so that the value of each variable area can be modified successfully separately. Therefore, when multiple threads apply to read shared data, and concurrent CAS operations modify the values of different variable areas, multiple CAS operations can be successful, which improves the success rate of CAS operations.
- FIG4 is a schematic diagram of the system architecture of a multi-threaded concurrent management method provided in the embodiment of the present application
- the system architecture may include one or more central processing units (CPU), one or more graphics processing units (GPU), or one or more system-on-chips (SOC), and a memory.
- CPU central processing units
- GPU graphics processing units
- SOC system-on-chips
- the basic unit for independent operation and independent scheduling of the processor is a thread.
- the system architecture shown in FIG4 includes multiple CPUs (such as CPU1-CPU5), wherein any one CPU (such as CPU1) can be used to execute the multi-threaded concurrent management method provided in the embodiment of the present application, firstly, the global variable used to control multi-threaded access to shared data is divided into multiple sub-variable areas, and multiple threads requesting to read shared data in multiple CPUs are grouped.
- the threads of different thread groups can be authorized to modify the flag bits in different sub-variable areas, and if the thread successfully modifies the flag bits, CPU1 can allow it to read the shared data in the memory.
- thread 1 when CPU1 runs independently and schedules thread 1 to apply for reading the shared data in the memory (taking the application for a read lock as an example), thread 1 can only modify the mark bit of the first partition of the global variable (such as the lock state variable). After the modification is successful, thread 1 can read the shared data; when CPU2 runs independently and schedules thread 2 to apply for reading the shared data, thread 2 can only modify the mark bit of the second partition of the global variable. After the modification is successful, thread 2 can read the shared data. Similarly, CPU3 runs or schedules thread 3 and CPU4 runs or schedules thread 4 to apply for reading the shared data. Thread 3 and thread 4 can modify the mark bits of the third partition and the fourth partition respectively. After the modification is successful, thread 3 and thread 4 can read the shared data.
- the global variable such as the lock state variable
- the length of the global variable can be 1 byte to 16 bytes, or even longer or shorter.
- the range in different architecture instruction sets may be different.
- Figure 4 only takes the global variable length equal to the cache line length as an example, which should not constitute a limitation on this application.
- each partition of the global variable can also include a control status bit (such as a write lock status bit).
- the control status bit of each partition can be modified.
- the control status bit of each of the four partitions can be modified. After the modification is successful, thread 5 can perform operations such as reading and writing on the shared data.
- the embodiments of the present application can be applied to various computer system architectures.
- the architecture in FIG. 4 above is only an exemplary implementation in the embodiments of the present application.
- the architecture applicable to the embodiments of the present application includes but is not limited to the above architecture.
- the architecture of the computer can have more or fewer units/modules than those shown in the figure, can combine two or more units/modules, or can have different unit/module configurations.
- Various units/modules can be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and/or application-specific integrated circuits.
- the multi-threaded concurrent management method provided in the embodiment of the present application can be executed by an electronic device.
- An electronic device refers to a device that can be abstracted as a computer system, wherein an electronic device that supports the above-mentioned multi-threaded concurrent management function can also be referred to as a multi-threaded concurrent management device.
- the multi-threaded concurrent management device can be a complete machine of the electronic device, such as: a server, a vehicle-mounted computer or a terminal device, and the terminal device can be a smart wearable device, a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; it can also be a system/device composed of multiple complete machines; it can also be a part of the electronic device, such as: a chip related to the multi-threaded concurrent management function, such as a processor, a system chip (system on a chip, SoC), etc., which is not specifically limited in the embodiment of the present application. Among them, the system chip is also called a system on chip. It is understandable that the above-mentioned multi-threaded concurrent management method provided in the embodiment of the present application can also be applied to the operating system, database, application software, middleware or underlying software of the above-mentioned electronic device.
- FIG. 5 is a flow chart of a multi-threaded concurrent management method provided in an embodiment of the present application, the method including but not limited to the following steps:
- the target global variable is used to control multi-threaded access to target data, which is a resource that can be shared by multiple threads, and can generally be referred to as shared data or shared resources.
- the target data can be specific data, for example, a table that is shared and queried; the target data can also refer to a critical section, that is, a program fragment that accesses a shared resource (such as a shared device, a shared memory, etc.).
- a global variable i.e., the target global variable
- FIG. 6 is a structural schematic diagram of a lock state variable partition provided in an embodiment of the present application, wherein, taking the length of the lock state variable as 8 bytes as an example, the lock state variable is divided into 4 2-byte regions (including partition 1, partition 2, partition 3 and partition 4) in the figure, and each partition may include one or more read lock count bits.
- the region for the global variable when dividing the region for the global variable, it can be divided equally (as shown in FIG6 ) or unequally, for example, it can be divided into four sub-variable regions with lengths of 1 byte, 1 byte, 2 bytes and 4 bytes, respectively, which is not specifically limited here.
- the length of the sub-variable region can be divided according to the number of threads in different thread groups. When the number of threads in a thread group is large, the length of the sub-variable region corresponding to the thread group can be longer; on the contrary, when the number of threads in a thread group is small, the length of the sub-variable region corresponding to the thread group can be shorter.
- the thread in order to ensure the consistency of the modification of the sub-variable area mark bit, the thread generally modifies the mark bit through atomic operations (such as CAS operations). Because the minimum unit that can be operated by atomic operations is 1 byte at present, the minimum length of a single sub-variable area in the global variable should be 1 byte; the maximum length of the entire global variable supports the maximum number of bytes that the computer can perform atomic operations on (such as cache lines).
- atomic operations such as CAS operations
- the global variable and the length range that the sub-variable area can support can also change accordingly, that is, the minimum length of the above-mentioned single sub-variable area is 1 byte, and the maximum length of the entire global variable is a cache line, which should not constitute a limitation on the embodiment of the present application.
- S503 Authorize a target thread in the target thread group to modify a flag bit in the target subvariable area.
- multiple threads applying to read the target data can be grouped so that the threads in the multiple thread groups can modify the mark bits in the multiple sub-variable areas respectively, and the threads in the target thread group modify the mark bits of the target sub-variable area.
- one thread group corresponds to one sub-variable area
- different thread groups correspond to different sub-variable areas, that is to say, a thread group in the multiple thread groups corresponds to a sub-variable area in the multiple sub-variable areas one by one.
- the multiple threads may need to read the target data in the process of executing a certain task, so they apply for permission to read the target data.
- the multiple threads can not only be used to apply for permission to read the target data, but also can be used to complete other tasks.
- the target thread group among the multiple thread groups includes multiple threads
- only one thread in the target thread group is allowed to successfully modify the mark bit in the sub-variable area (i.e., the target sub-variable area) corresponding to the target thread group.
- the mark bit in the sub-variable area i.e., the target sub-variable area
- only one thread can successfully modify the mark bit, thereby ensuring the consistency of the modification of the mark bit of the sub-variable area and avoiding confusion.
- Other threads in the same thread group that fail to modify the mark bit can try again to modify the mark bit of the sub-variable area corresponding to the thread group.
- the grouping of threads can be based on thread IDs, for example, threads 0 to 9 belong to group 1, threads 10 to 19 belong to group 2, threads 20 to 29 belong to group 3, etc.; the grouping of threads can also be based on identifying the group of the threads when they are created, for example, the threads created by CPU1 are identified as group 1, the threads created by CPU2 are identified as group 2, the threads created by CPU3 are identified as group 3, etc.
- a request to read the target data may be applied for through the thread, that is, the thread is allowed to read the target data.
- the threads in Group 1 can modify the mark bit (read lock count bit) in Partition 1
- the threads in Group 2 can modify the mark bit in Partition 2, and so on.
- the threads in Group 1 apply to read the target data, it is equivalent to applying for a read lock.
- the thread can perform a lock state judgment on the 2 bytes corresponding to the thread group (e.g., Partition 1) according to the group of the thread group to which it belongs, to determine whether no thread holds a write lock, and then modify the read lock count bit of the 2 bytes (e.g., an atomic plus 1 operation). If the modification is successful, the thread holds the read lock. Corresponding to the application for read is the release. When the thread in the first group wants to release the target data, it is equivalent to applying for a read lock. The thread modifies the read lock count bit of the 2 bytes (partition 1) corresponding to the thread group according to the group of its own thread group (atomic minus 1 operation). If the modification is successful, the thread releases the read lock.
- Partition 1 the group of the thread group to which it belongs
- each of the above sub-variable areas may also include a control status bit, and the control status bit is used to indicate whether the target data is exclusively owned.
- the control status bit is a write lock status bit, which is used to indicate whether a thread holds a write lock.
- each partition also includes a write lock status bit.
- the above method may also include steps S505 and S506, wherein,
- the thread needs to modify the control status bit in each sub-variable area. If the thread successfully modifies the control status bit, the request for exclusive use of the above-mentioned target data can be applied through this thread, that is, the thread is allowed to exclusively use the above-mentioned target data.
- the lock state variable length is 8 bytes
- the 4 sub-variable areas are all 2 bytes as an example
- the control status bit is the write lock status bit.
- a thread in the above-mentioned multiple thread groups applies for exclusive use of the target data, it is equivalent to applying for adding a write lock.
- the thread needs to perform a lock state judgment on the 8 bytes to determine whether no thread holds a write lock or a read lock, and then modify the write lock status bit in each 2-byte partition (such as an atomic addition operation). If the modification is successful, the thread holds the write lock.
- Corresponding to applying for exclusive control is releasing exclusive control.
- a thread wants to release the exclusive control over the target data it is equivalent to applying for a write lock.
- the thread modifies the write lock status bit in each 2-byte partition (such as an atomic minus 1 operation). If the modification is successful, the thread releases the write lock.
- the above method may further include step S507 in addition to steps S501 to S506, wherein:
- S507 Determine the total number of threads that can currently read the target data according to the status of the mark bit in each sub-variable area.
- the lock state variable length is 8 bytes
- the 4 sub-variable areas are all 2 bytes as an example
- the read lock count bit of partition 1 indicates that 3 threads hold read locks
- partition 2 indicates that 5 threads hold read locks
- partition 3 indicates that 2 threads hold read locks
- partition 4 indicates that 2 threads hold read locks
- the read-write lock when the read-write lock is in the read lock state, and another thread attempts to apply for a write lock, the request to apply for a write lock will fail, and the thread may temporarily sleep.
- the read-write lock After the thread applies for a write lock, the read-write lock usually blocks subsequent read lock requests to avoid long-term occupation of the read lock state, which causes the thread requesting the write lock to wait for a long time.
- the thread that previously failed to apply for a write lock and temporarily sleeps can be awakened, and then through the write lock request of this thread, it is allowed to hold the write lock, allowing it to read, write, and other operations on the above target data.
- Figure 7 is a result schematic diagram of a multi-threaded grouping and simultaneous CAS operation provided by the embodiment of the present application, taking 4 threads adding read locks at the same time, dividing the 4 threads into 2 groups, and each group of 2 threads as an example, the present value is read in the memory storing the lock state variable, and the old value and the new value are the incoming values of the CAS operation.
- the valid CAS operation is 4 times
- the invalid CAS operation is 2 times, which is reduced from 6 times in the example of Figure 3 to 2 times, and the number of concurrent rounds is also reduced from 4 rounds to 2 rounds.
- threads 1 and 2 in group 1 simultaneously add read locks (the first round of concurrency)
- only one thread for example, thread 1 can successfully modify the mark bit of the sub-variable area corresponding to the thread group; then thread 2 can immediately retry the process of adding read locks (the second round) based on the latest value of the current sub-variable area, and successfully modify the mark bit of the sub-variable area and hold the read lock.
- threads 3 and 4 in group 2 are in the first round of concurrency, one of the threads (for example, thread 3) successfully modifies the mark bit and holds the read lock; then the other thread can successfully modify it in the second round and also holds the read lock.
- the mark bit of the sub-variable area corresponding to each thread group can be modified.
- these four threads can successfully modify the mark bit of the sub-variable area in one round of concurrency, that is, the number of modification operation failures is 0.
- the pinbuffer/unpinbuffer function implements functions similar to read and write, and can share, monopolize, and control other status identifications of data pages. Among them, sharing uses a shared count (similar to adding and reading locks), and each time a thread queries a data page, it is necessary to add a read lock to the index root directory page. In the Kunpeng 2P+openGauss (open source Gauss) scenario, the concurrent access volume of the same page is extremely large.
- Figure 8 is a performance analysis perf flame graph provided by the embodiment of the present application. Among them, when the query performance of openGauss is 1.1 million queries per second (query per second, QPS), the atomic operation instruction overhead of adding and reading locks has exceeded 50%, and the CPU is fully loaded.
- the performance of the computer system can be seen in Figure 10, which is another performance analysis perf flame graph provided by the embodiment of the present application, wherein the query performance of openGauss is improved to 1.56 million QPS, and the atomic operation instruction overhead of the unlocking and decoding has been reduced to 14%.
- the query performance of openGauss is improved by 41%, and the unlocking and decoding performance is improved by 5 times.
- the present application proposes a multi-threaded concurrent management method, which divides the global variable used to control multi-threaded access to shared data into multiple areas, divides the multiple threads applying to read the shared data into multiple thread groups, and makes one thread group correspond to one variable area, and different thread groups correspond to different variable areas, so that when threads in different thread groups apply to read shared data, they can obtain the permission to read the shared data by modifying the value of the corresponding variable area.
- the modification of the values of different variable areas between threads in different thread groups is independent, so that the value of each variable area can be modified successfully respectively, that is, in one round of concurrent modification, multiple threads can be modified successfully.
- FIG. 11 is a schematic diagram of the structure of a multi-threaded concurrent management device provided in an embodiment of the present application.
- the device 110 may include a first processing unit 1101, a second processing unit 1102, and a third processing unit 1103, and may also include a determination unit 1104.
- the detailed description of each unit is as follows:
- the first processing unit 1101 is used to divide the target global variable into a plurality of sub-variable areas; the target global variable is used to control multi-threaded access to target data, and each of the plurality of sub-variable areas includes one or more flag bits;
- the second processing unit 1102 is used to divide the multiple threads into multiple thread groups; the multiple threads are used to apply for permission to read the target data;
- Target thread group is one of the multiple thread groups
- target sub-variable region is one of the multiple sub-variable regions
- one of the multiple thread groups and one of the multiple sub-variable regions correspond to each other one by one
- the third processing unit 1103 is configured to allow the target thread to read the target data if the target thread successfully modifies the mark bit.
- the device further includes:
- the determining unit 1104 is configured to determine the total number of threads that can currently read the target data according to the status of the flag bit in each sub-variable area.
- a target thread group among the multiple thread groups includes multiple threads
- one thread in the target thread group is allowed to successfully modify a flag bit in a target sub-variable area corresponding to the target thread group.
- the second processing unit 1102 is specifically configured to:
- the target thread in the target thread group is authorized to modify the mark bit in the target sub-variable area through a compare and exchange (CAS) operation.
- CAS compare and exchange
- each of the sub-variable regions further includes a control status bit, and the control status bit is used to indicate whether the target data is exclusively occupied; the second processing unit 1102 is further used to authorize the first thread to modify the control status bit of each sub-variable region respectively when the first thread of the target thread group among the multiple thread groups applies for exclusive use of the target data;
- the third processing unit 1103 is further configured to allow the first thread to exclusively occupy the target data if the first thread successfully modifies the control status bit.
- the second processing unit 1102 is specifically configured to:
- the first thread is authorized to modify the control status bit of each sub-variable area through a CAS operation.
- the global variable is a lock state variable
- the mark bit is a read lock count bit
- the threads in the multiple thread groups modify the mark bit in the sub-variable area to add a read lock or an unread lock.
- the global variable is a lock state variable
- the control state bit is a write lock state bit
- the threads in the multiple thread groups modify the control state bit in the sub-variable area to add a write lock or release a write lock.
- FIG12 is a schematic diagram of the structure of another multi-threaded concurrent management device provided in an embodiment of the present application, wherein the device 120 includes at least one processor 1201, at least one memory 1202, and at least one communication interface 1203.
- the device may also include common components such as an antenna, which will not be described in detail here.
- Processor 1201 can be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the above program.
- CPU central processing unit
- ASIC application-specific integrated circuit
- the communication interface 1203 is used to communicate with other devices or communication networks, such as Ethernet, radio access network (RAN), core network, wireless local area networks (WLAN), etc.
- RAN radio access network
- WLAN wireless local area networks
- the memory 1202 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.
- the memory may exist independently and be connected to the processor through a bus. The memory may also be integrated with the processor.
- the memory 1202 is used to store application code for executing the multi-thread concurrent management method described above, and the execution is controlled by the processor 1201.
- the processor 1201 is used to execute the application code stored in the memory 1202.
- the code stored in the memory 1202 can execute the multi-threaded concurrency management method provided in Figure 5 above, such as dividing the target global variable into multiple sub-variable areas; the target global variable is used to control multi-threaded access to target data, and each of the multiple sub-variable areas includes one or more flag bits; dividing multiple threads into multiple thread groups; the multiple threads are used to apply for permission to read the target data; authorizing the target thread in the target thread group to modify the flag bit in the target sub-variable area; the target thread group is one of the multiple thread groups, and the target sub-variable area is one of the multiple sub-variable areas, and one of the thread groups in the multiple thread groups corresponds to one of the multiple sub-variable areas; if the target thread successfully modifies the flag bit, the target thread is allowed to read the target data.
- the multi-threaded concurrent management device described in this application is not limited to this.
- the multi-threaded concurrent management device can be located in any electronic device, such as a server, a computer, a mobile phone, a tablet, and other devices.
- the multi-threaded concurrent management device can specifically be a chip or a chipset or a circuit board equipped with a chip or a chipset.
- the chip or chipset or the circuit board equipped with a chip or a chipset can work under the necessary software drive.
- the multi-threaded concurrent management device can be:
- the IC set may also include a storage component for storing data and computer programs;
- An embodiment of the present application further provides a computer-readable storage medium, in which a computer program code is stored.
- a computer program code is stored.
- the embodiment of the present application also provides an electronic device, which can exist in the form of a chip product, and the electronic device includes a processor, and the processor is configured to support the electronic device to implement the corresponding functions of the method in any of the above embodiments.
- the electronic device may also include a memory, which is coupled to the processor and stores the necessary program instructions and data of the electronic device.
- the electronic device may also include a communication interface for the electronic device to communicate with other devices or a communication network.
- the embodiment of the present application also provides a computer program product.
- the computer program product When the computer program product is run on a computer, the computer executes the method in any of the aforementioned embodiments.
- the embodiment of the present application provides a chip system, which includes a processor for supporting a device to implement the functions involved in the first aspect, for example, generating or processing the information involved in the multi-threaded concurrent management method.
- the chip system also includes a memory, which is used to store program instructions and data necessary for the device.
- the chip system can be composed of a chip, or it can include a chip and other discrete devices.
- the disclosed device can be implemented in other ways.
- the device embodiments described above are only schematic, such as the division of the above-mentioned units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
- Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
- the units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present application.
- each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
- the above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
- the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
- the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product.
- the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server or a network device, etc., specifically a processor in a computer device) to perform all or part of the steps of the above-mentioned methods in each embodiment of the present application.
- the aforementioned storage medium may include: U disk, mobile hard disk, magnetic disk, optical disk, read-only memory (read-only memory, abbreviated: ROM) or random access memory (random access memory, abbreviated: RAM) and other media that can store program codes.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Storage Device Security (AREA)
Abstract
Description
Claims (21)
- 一种多线程并发管理方法,其特征在于,所述方法包括:将目标全局变量划分为多个子变量区;所述目标全局变量用于控制多线程访问目标数据,所述多个子变量区中每个子变量区包括一个或多个标记位;将多个线程划分为多个线程组;所述多个线程用于申请对所述目标数据进行读取的权限;授权目标线程组中的目标线程对目标子变量区中的标记位进行修改;其中,所述目标线程组为所述多个线程组中的一个线程组,所述目标子变量区为所述多个子变量区中的一个子变量区,所述多个线程组中的一个线程组和所述多个子变量区中的一个子变量区一一对应;若所述目标线程修改标记位成功,则允许所述目标线程读取所述目标数据。
- 如权利要求1所述的方法,其特征在于,所述方法还包括:通过所述每个子变量区中标记位的状态确定当前可读取所述目标数据的线程总数。
- 如权利要求1-2中任一项所述的方法,当所述目标线程组包括多个线程时,在一个时钟周期内,所述目标线程组中的一个线程被允许成功修改所述目标子变量区中的标记位。
- 如权利要求1-3中任一项所述的方法,其特征在于,所述授权目标线程组中的目标线程对目标子变量区中的标记位进行修改,包括:若当前无线程独占所述目标数据,授权所述目标线程组中的目标线程通过比较和交换CAS操作对所述目标子变量区中的标记位进行修改。
- 如权利要求1-4中任一项所述的方法,其特征在于,所述每个子变量区还包括控制状态位,所述控制状态位用于指示所述目标数据是否被独占;所述方法,还包括:在所述目标线程组的第一线程申请对所述目标数据进行独占时,授权所述第一线程分别对所述每个子变量区的控制状态位进行修改;若所述第一线程修改控制状态位成功,则允许所述第一线程独占所述目标数据。
- 如权利要求5所述的方法,其特征在于,所述授权所述第一线程分别对所述每个子变量区的控制状态位进行修改,包括:若当前无线程独占或读取所述目标数据,授权所述第一线程通过CAS操作对所述每个子变量区的控制状态位进行修改。
- 如权利要求1-6中任一项所述的方法,其特征在于,所述全局变量为锁状态变量,所述标记位为读锁计数位,所述多个线程组中的线程针对子变量区中标记位的修改用于加读锁或解读锁。
- 如权利要求5-6中任一项所述的方法,其特征在于,所述全局变量为锁状态变量,所述控制状态位为写锁状态位,所述多个线程组中的线程针对子变量区中控制状态位的修改用于加写锁或解写锁。
- 一种多线程并发管理装置,其特征在于,包括:第一处理单元,用于将目标全局变量划分为多个子变量区;所述目标全局变量用于控制多线程访问目标数据,所述多个子变量区中每个子变量区包括一个或多个标记位;第二处理单元,用于将多个线程划分为多个线程组;所述多个线程用于申请对所述目标数据进行读取的权限;授权目标线程组中的目标线程对目标子变量区中的标记位进行修改;其中,所述目标线程组为所述多个线程组中的一个线程组,所述目标子变量区为所述多个子变量区中的一个子变量区,所述多个线程组中的一个线程组和所述多个子变量区中的一个子变量区一一对应;第三处理单元,用于若所述目标线程修改标记位成功,则允许所述目标线程读取所述目标数据。
- 如权利要求9所述的装置,其特征在于,所述装置还包括:确定单元,用于通过所述每个子变量区中标记位的状态确定当前可读取所述目标数据的线程总数。
- 如权利要求9-10中任一项所述的装置,其特征在于,当所述目标线程组包括多个线程时,在一个时钟周期内,所述目标线程组中的一个线程被允许成功修改所述目标子变量区中的标记位。
- 如权利要求9-11中任一项所述的装置,其特征在于,所述第二处理单元,具体用于:若当前无线程独占所述目标数据,授权所述目标线程组中的目标线程通过比较和交换CAS操作对所述目标子变量区中的标记位进行修改。
- 如权利要求9-12中任一项所述的装置,其特征在于,所述每个子变量区还包括控制状态位,所述控制状态位用于指示所述目标数据是否被独占;所述第二处理单元,还用于在所述目标线程组的第一线程申请对所述目标数据进行独占时,授权所述第一线程分别对所述每个子变量区的控制状态位进行修改;所述第三处理单元,还用于若所述第一线程修改控制状态位成功,则允许所述第一线程独占所述目标数据。
- 如权利要求13所述的装置,其特征在于,所述第二处理单元,具体用于:若当前无线程独占或读取所述目标数据,授权所述第一线程通过CAS操作对所述每个子变量区的控制状态位进行修改。
- 如权利要求9-14中任一项所述的装置,其特征在于,所述全局变量为锁状态变量,所述标记位为读锁计数位,所述多个线程组中的线程针对子变量区中标记位的修改用于加读锁或解读锁。
- 如权利要求13-14中任一项所述的装置,其特征在于,所述全局变量为锁状态变量,所述控制状态位为写锁状态位,所述多个线程组中的线程针对子变量区中控制状态位的修改用于加写锁或解写锁。
- 一种多线程并发管理装置,其特征在于,包括处理器和接口电路,所述接口电路用于接收来自其它通信装置的信号并传输至所述处理器或将来自所述处理器的信号发送给其它通信装置,所述处理器通过逻辑电路或执行代码指令用于实现如权利要求1-8中任一项所述的方法。
- 一种计算机可读存储介质,其特征在于,所述存储介质中存储有计算机程序或指令,当所述计算机程序或指令被通信装置执行时,实现如权利要求1-8中任一项所述的方法。
- 一种计算机程序,其特征在于,所述计算机程序包括指令,当所述计算机程序被通信装置执行时,实现如权利要求1-8中任一项所述的方法。
- 一种服务器,其特征在于,包括处理器和存储器,其中,所述存储器用于存储程序代码,所述程序代码被所述处理器执行时,所述服务器实现如权利要求1-8中任一项所述的方法。
- 一种芯片系统,其特征在于,所述芯片系统包括处理器,用于支持设备实现如权利要求1-8中任一项所述的方法所涉及的功能。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310717179.1A CN119149177A (zh) | 2023-06-15 | 2023-06-15 | 一种多线程并发管理方法和相关装置 |
| CN202310717179.1 | 2023-06-15 |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| WO2024255500A1 true WO2024255500A1 (zh) | 2024-12-19 |
| WO2024255500A8 WO2024255500A8 (zh) | 2025-10-23 |
Family
ID=93813887
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2024/092938 Pending WO2024255500A1 (zh) | 2023-06-15 | 2024-05-13 | 一种多线程并发管理方法和相关装置 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN119149177A (zh) |
| WO (1) | WO2024255500A1 (zh) |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20100332770A1 (en) * | 2009-06-26 | 2010-12-30 | David Dice | Concurrency Control Using Slotted Read-Write Locks |
| CN113835901A (zh) * | 2013-10-15 | 2021-12-24 | 北京奥星贝斯科技有限公司 | 读锁操作方法、写锁操作方法及系统 |
| CN115756863A (zh) * | 2022-11-30 | 2023-03-07 | 天翼电子商务有限公司 | 一种高并发场景下的多线程cas操作管理方法及系统 |
| CN116028189A (zh) * | 2023-02-13 | 2023-04-28 | 广州文远知行科技有限公司 | 多线程服务退出方法、装置、存储介质和计算机设备 |
-
2023
- 2023-06-15 CN CN202310717179.1A patent/CN119149177A/zh active Pending
-
2024
- 2024-05-13 WO PCT/CN2024/092938 patent/WO2024255500A1/zh active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20100332770A1 (en) * | 2009-06-26 | 2010-12-30 | David Dice | Concurrency Control Using Slotted Read-Write Locks |
| CN113835901A (zh) * | 2013-10-15 | 2021-12-24 | 北京奥星贝斯科技有限公司 | 读锁操作方法、写锁操作方法及系统 |
| CN115756863A (zh) * | 2022-11-30 | 2023-03-07 | 天翼电子商务有限公司 | 一种高并发场景下的多线程cas操作管理方法及系统 |
| CN116028189A (zh) * | 2023-02-13 | 2023-04-28 | 广州文远知行科技有限公司 | 多线程服务退出方法、装置、存储介质和计算机设备 |
Also Published As
| Publication number | Publication date |
|---|---|
| WO2024255500A8 (zh) | 2025-10-23 |
| CN119149177A (zh) | 2024-12-17 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP3701377B1 (en) | Method and apparatus for updating shared data in a multi-core processor environment | |
| CN111666330B (zh) | 数据的读写方法和装置 | |
| US9690737B2 (en) | Systems and methods for controlling access to a shared data structure with reader-writer locks using multiple sub-locks | |
| US20110161540A1 (en) | Hardware supported high performance lock schema | |
| EP3404537B1 (en) | Processing node, computer system and transaction conflict detection method | |
| JPH10134008A (ja) | 半導体装置およびコンピュータシステム | |
| JPH04308961A (ja) | 占有されたプロセスの同期ロックの状態を通知するための手段及び装置 | |
| CN107807858A (zh) | 一种读写锁操作方法及系统、设备 | |
| CN113407414A (zh) | 程序运行监测方法、装置、终端及存储介质 | |
| CN108572876B (zh) | 一种读写锁的实现方法及装置 | |
| EP3379421B1 (en) | Method, apparatus, and chip for implementing mutually-exclusive operation of multiple threads | |
| CN114780248B (zh) | 资源访问方法、装置、计算机设备及存储介质 | |
| CN114327642A (zh) | 一种数据读写的控制方法及电子设备 | |
| WO2024255500A1 (zh) | 一种多线程并发管理方法和相关装置 | |
| JP7346649B2 (ja) | 同期制御システムおよび同期制御方法 | |
| JP4734348B2 (ja) | 共有メモリ型マルチプロセッサにおける非同期遠隔手続き呼び出し方法、非同期遠隔手続き呼び出しプログラムおよび記録媒体 | |
| CN103885824A (zh) | 接口控制电路、设备和标识切换方法 | |
| CN121166607B (zh) | 基于位图的内存管理方法、内存管理单元、系统及介质 | |
| CN117785767B (zh) | 消息同步方法、系统以及相关装置 | |
| US8301845B2 (en) | Access control method and computer system | |
| JP2010026575A (ja) | スケジューリング方法およびスケジューリング装置並びにマルチプロセッサシステム | |
| CN118260090A (zh) | 自旋锁管理装置、方法、存储介质和程序产品 | |
| JPS5834856B2 (ja) | キオクセイギヨソウチ | |
| JP2785738B2 (ja) | 分散メモリ型マルチプロセッサ情報処理システム | |
| CN118227344A (zh) | 一种共享内存保护方法和微处理芯片 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 24822452 Country of ref document: EP Kind code of ref document: A1 |
|
| WWE | Wipo information: entry into national phase |
Ref document number: 2024822452 Country of ref document: EP |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| ENP | Entry into the national phase |
Ref document number: 2024822452 Country of ref document: EP Effective date: 20260115 |
|
| ENP | Entry into the national phase |
Ref document number: 2024822452 Country of ref document: EP Effective date: 20260115 |
|
| ENP | Entry into the national phase |
Ref document number: 2024822452 Country of ref document: EP Effective date: 20260115 |
|
| ENP | Entry into the national phase |
Ref document number: 2024822452 Country of ref document: EP Effective date: 20260115 |