Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

A method, device and server for orderly control and storage information of lock-free threads

A technology to control storage and storage location, applied in multi-program device, program control design, program synchronization, etc., can solve the problems of reducing concurrency efficiency and increasing additional overhead, and achieve the effect of reducing additional overhead and improving concurrency efficiency

Active Publication Date: 2022-04-19
JUHAOKAN TECH CO LTD
View PDF5 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] In order to enable lock-free threads to read and write stored data in an orderly manner, there are blocking or non-blocking algorithms for storage queues, but they must ensure that concurrent threads access the same storage node synchronously (for ease of description, hereinafter referred to as shared storage nodes) to maintain the integrity of the storage queue Respectively, by delaying the queue (such as: generating and verifying additional unique codes) or restricting multi-threading to complete operations on shared storage nodes in the storage queue within limited steps (such as: adding virtual nodes and controlling their entry and exit), so that added overhead
[0004] In some cases, such as when more threads on the server need to frequently read and write storage nodes in the storage queue, the outstanding additional overhead will also reduce the concurrency efficiency

Method used

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

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A method, device and server for orderly control and storage information of lock-free threads
  • A method, device and server for orderly control and storage information of lock-free threads
  • A method, device and server for orderly control and storage information of lock-free threads

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0049] In some cases, such as the distributed client centrally produces payment orders based on the user's purchase of goods, and sends the payment order to the server, and the server processes each payment order. In order to improve the user's consumption experience, the server needs to store the consumption data in the payment order in a timely manner. Give client feedback. At this time, concurrent lock-free threads storing consumption data will frequently seize shared storage nodes, and storage nodes will also frequently enter and exit from the storage queue. Correspondingly, multi-threaded reading of consumption data in the server will also increase the frequency of entering and exiting queues. In order to consider the integrity of the data structure in the storage queue, adding virtual nodes or additional identifiers will reduce the concurrency efficiency.

[0050] In order to improve the concurrency efficiency of threads in the above situation, such as figure 1 As shown, ...

Embodiment 2

[0088] In some cases, such as distributed client sharing bullet chatting information through communication and interaction with the server, the bullet chatting information produced based on user editing behavior on a client is sent to the server, and the server feeds back the bullet chatting information based on video requests on other clients. The barrage information is shared by distributed clients, and the live video is played centrally on the client. At this time, the server reads the barrage information and inserts the barrage information into the live video. When the interaction between the server and the distributed client is frequent , different barrage information also needs to be continuously inserted into the live video.

[0089] In order to improve the thread concurrency efficiency in the above situation, such as Figure 5 As shown, the present application provides another method for a lock-free thread to control and store information in a circular queue, and the s...

Embodiment 3

[0115] Based on the same idea, Embodiment 2 of the present invention also provides a device for processing resource data, which can be implemented by software, or by hardware or a combination of software and hardware. Taking software implementation as an example, the device for processing test data of the present invention, as a device in a logical sense, is formed by reading the corresponding computer program instructions in the memory through the CPU equipped with it and then running it.

[0116] In an exemplary embodiment of the present invention, a lock-free thread controls and stores information in a circular queue. The basic operating environment of the device includes CPU, memory and other hardware. From a logical perspective, the logical structure of the device 800 Such as Figure 8 As shown, it includes: an instruction call unit 810 , a state modification unit 820 , a node allocation unit 830 and a cursor update unit 840 .

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

PUM

No PUM Login to View More

Abstract

The invention relates to the technical field of data storage, and provides a method, device and server for orderly controlling and storing information by lock-free threads. The method includes: according to the non-release state of the shared storage node in the circular queue, calling the CAS instruction during the period when the focus thread in the at least two first threads stores the current data in the shared storage node; The release state is changed to the release state, and the release state is used to indicate that the second thread can read the current data; the second thread is allocated a shared storage node in the release state; according to the storage position of the shared storage node in the circular queue and the original cursor in the CAS instruction Consistency, update the original cursor with a single vector, so that the focus thread locks the shared storage node. In this way, the threads can be controlled to access data in an orderly manner, which overcomes the additional overhead of controlling the storage queue and improves the thread concurrency efficiency.

Description

technical field [0001] The invention relates to the technical field of data storage, in particular to a method and a device for controlling and storing information in a circular queue by a lock-free thread. Background technique [0002] In related technologies, in order to avoid data conflicts caused by threads of applications or operating systems reading and writing stored data from the storage queue at the same time, the thread is locked to control its serial read and write operations. After the lock is released, the suspended thread can be locked to read and write the stored data serially, which limits the concurrency efficiency of the storage queue, so it is obviously more efficient to use the lock-free thread method. [0003] In order to enable lock-free threads to read and write stored data in an orderly manner, there are blocking or non-blocking algorithms for storage queues, but they must ensure that concurrent threads access the same storage node synchronously (for ...

Claims

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

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F9/52G06F9/54
CPCG06F9/522G06F9/542
Inventor 刘希伟王绍民张凡文
Owner JUHAOKAN TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products