Multi-thread linked list processing method and device and computer readable storage medium

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 operation, thread lock failure, etc., to improve data processing efficiency and not easy to destroy and unusual effects

Inactive Publication Date: 2019-12-20
GUILIN CHANGHAI DEV
View PDF8 Cites 3 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
  • Multi-thread linked list processing method and device and computer readable storage medium
  • Multi-thread linked list processing method and device and computer readable storage medium
  • Multi-thread linked list processing method and device and computer readable storage medium

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 invention provides a multi-thread linked list processing method and device and a computer readable storage medium. The multi-thread linked list processing method comprises the steps: building a main thread and a plurality of sub-threads, enabling a linked list to be loaded into the main thread, and enabling state information to comprise a processed identification and an unprocessed identification; after the sub-thread is started, obtaining a target node with an unprocessed identifier from the linked list, carrying out data processing on the data of the target node, if the processing succeeds, updating the state information of the target node into a processed identifier in the linked list, and obtaining the next node from the linked list again; and traversing each node in the updated linked list by the main thread, and deleting the node of which the state information is the processed identifier in the traversing process. According to the multi-thread linked list processing method, the main thread and the plurality of sub-threads are adopted to process the data together, and the state information of the nodes is added into the data of the linked list, and the plurality of sub-threads process the data of the nodes in the linked list in parallel, and the influence on other sub-threads does not need to be considered, and the data processing efficiency is improved, and the linkedlist is not easy to damage.

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 Applications(China)
IPC IPC(8): G06F16/901G06F9/46G06F9/52
CPCG06F9/46G06F9/524G06F16/9024
Inventor 汤红燕王峰方皓莫易孙畅唐毅龙陈丽洁
Owner GUILIN CHANGHAI DEV
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products