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

A method, device, and computer-readable storage medium for processing a multi-threaded linked list

A processing method and multi-threading technology, applied in the direction of multi-program device, calculation, program control design, etc., can solve problems such as deadlock, inability to link list operations, thread lock failure, etc., to improve data processing efficiency and not easily damaged and unusual effects

Inactive Publication Date: 2021-11-23
GUILIN CHANGHAI DEV
View PDF8 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0002] At present, the data synchronization between threads in the industry adopts the method of thread lock. When a thread needs to operate the linked list, a thread lock is created to lock the linked list, and the lock is opened after the business is processed; during the locked period of the linked list, other linked lists You will not be able to operate on the linked list, and wait for the lock to be opened before you can perform business processing; if a certain thread business processing is abnormal, it will often be deadlocked; there may also be a thread lock failure at a certain time when the program is running. When multiple threads process the linked list at the same time, the linked list iteration exception will occur

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 computer-readable storage medium for processing a multi-threaded linked list
  • A method, device, and computer-readable storage medium for processing a multi-threaded linked list
  • A method, device, and computer-readable storage medium for processing a multi-threaded linked list

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0020] The principles and features of the present invention are described below in conjunction with the accompanying drawings, and the examples given are only used to explain the present invention, and are not intended to limit the scope of the present invention.

[0021] figure 1 It is a schematic flowchart of a method for processing a multi-threaded linked list provided by an embodiment of the present invention.

[0022] Such as figure 1 As shown, a method for processing a multithreaded linked list includes the following steps:

[0023] Create a main thread and a plurality of sub-threads, and set a plurality of start information of the sub-threads, the start information includes the start order of each of the sub-threads;

[0024] Start the main thread, start each of the sub-threads according to the startup information, load a linked list into the main thread, the linked list includes a plurality of nodes and state information and business data corresponding to each of the...

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 present invention provides a multi-thread linked list processing method, device and computer-readable storage medium. The method includes: creating a main thread and multiple sub-threads, loading the linked list into the main thread, and the state information includes a processed identifier and an unprocessed identifier; After the thread is started, obtain a target node with an unprocessed ID from the linked list, and process the data of the target node. If the processing is successful, update its status information in the linked list to the processed ID, and obtain the next node from the linked list again. Node: The main thread traverses each node in the updated linked list, and deletes the node whose status information is marked as processed during the traverse process. The main thread and multiple sub-threads jointly process data, adding node status information to the data in the linked list, and multiple sub-threads process the data of nodes in the linked list in parallel, without considering the impact on other sub-threads, and the data processing efficiency is improved. Linked lists are also not vulnerable to corruption.

Description

technical field [0001] The present invention mainly relates to the technical field of thread processing, in particular to a multi-thread linked list processing method, device and computer-readable storage medium. Background technique [0002] At present, the data synchronization between threads in the industry adopts the method of thread lock. When a thread needs to operate the linked list, a thread lock is created to lock the linked list, and the lock is opened after the business is processed; during the locked period of the linked list, other linked lists You will not be able to operate on the linked list, and wait for the lock to be opened before you can perform business processing; if a certain thread business processing is abnormal, it will often be deadlocked; there may also be a thread lock failure at a certain time when the program is running. When multiple threads process the linked list at the same time, the linked list iteration exception will occur. Contents of...

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): G06F16/901G06F9/46G06F9/52
CPCG06F9/46G06F9/524G06F16/9024
Inventor 汤红燕王峰方皓莫易孙畅唐毅龙陈丽洁
Owner GUILIN CHANGHAI DEV
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More