Unlock instant, AI-driven research and patent intelligence for your innovation.

Implementation method of double-layer lockless hash table with aging deletion based on collision

An implementation method and a two-layer technology, applied in the field of data processing, can solve problems such as efficiency problems, timer aging, casd multiple executions, etc.

Active Publication Date: 2021-05-11
山东兆物网络技术股份有限公司
View PDF4 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, the above two aging deletion methods have disadvantages. The disadvantage of using a timer for aging deletion: using a proprietary hardware timer or a third-party software timer for aging deletion will use additional memory resources, which is at least double the amount to be precise. memory resources
[0007] Lock-free operations in concurrent scenarios, deleting elements will face ABA problems. The root of the ABA problem is that cas cannot record the state of variables when modifying variables, such as modifying The number of times, whether this variable has been modified
In this way, when one thread modifies A to B, another thread will modify B to A again, causing casd to execute multiple times.
And ABA problems are usually more likely to emerge at the moment of deletion
[0008]The traditional approach is to implement a garbage collection mechanism and use freelist for final deletion. This approach has no logical problems in concurrent scenarios, but has efficiency problems, especially in resource In a limited hardware system, if a hash table with a garbage collection mechanism is established, the code size and complexity of garbage collection will greatly exceed the hash table itself

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
  • Implementation method of double-layer lockless hash table with aging deletion based on collision
  • Implementation method of double-layer lockless hash table with aging deletion based on collision
  • Implementation method of double-layer lockless hash table with aging deletion based on collision

Examples

Experimental program
Comparison scheme
Effect test

Embodiment

[0038] Such as Figure 1 to Figure 4 shown, including the following steps:

[0039] S1: Set up a double-layer hash table; the specific steps of S1 include setting two different hash functions, assigning a double-layer hash table, and calculating for the same key to obtain two different index values, one of which is an index value Locate the position of the first-level table, and the second index value locates the position of the second-level table; this setting will increase the dispersion rate and make the data more evenly distributed in the hash table. The structure of the two tables is as follows figure 1 shown; reference figure 1 It can be seen that the double-layer hash method is more discrete than the single-layer hash method, which can make the elements in the hash table more evenly distributed, which means that in the face of the same data, especially in concurrent scenarios, double-layer hash can be faster perform lookup and insert operations.

[0040] S2: Perfor...

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 processing, in particular to a collision-based double-layer lockless hash table implementation method with aging deletion. The collision-based double-layer lock-free hash table implementation method with aging deletion comprises the following steps: S1, setting a double-layer hash table; S2, carrying out lock-free operation; S3, carrying out an operation mode of a skip list and a double linked list; S4, on the basis of the step S3, executing FIFO control. The invention provides a collision-based double-layer lock-free hash table implementation method with aging deletion.

Description

technical field [0001] The invention relates to the technical field of data processing, in particular to a method for realizing a collision-based double-layer lock-free hash table with aging deletion. Background technique [0002] The structure of the general hash table is mostly like this: Create a hash table according to the given number of elements; select the hash algorithm, the candidate algorithm is crc md5 murmur.. etc.; install the candidate algorithm for the input key and keysize It is calculated to obtain a value, and then the value is calculated based on the given total number of elements to obtain the index value; jump to the index entry where the hash table is located, and perform addition, deletion, modification and query operations; for the same index value but different content The element situation is called a collision. For this situation, the linked list operation is performed, and the element is added to the end of the linked list. [0003] The above met...

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
IPC IPC(8): G06F16/22G06F16/901
CPCG06F16/2255G06F16/2282G06F16/9014G06F16/9024
Inventor 谭宇翔
Owner 山东兆物网络技术股份有限公司