A Data Acquisition Method Based on Lock-Free Buffer

A data acquisition and buffer technology, applied in the direction of program synchronization, multi-programming device, etc., can solve the problems of few applications, large number of tasks, dependent on the number of threads, etc., and achieve the effect of avoiding blocking

Active Publication Date: 2018-03-16
ZHEJIANG UNIV
View PDF2 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

That is to say, only after all the operations of the current thread are completed, other threads can start tasks, but in reality, the number of tasks of a thread may be very large, this method is very dependent on the number of threads, so it is rarely used in practice ;

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 Data Acquisition Method Based on Lock-Free Buffer
  • A Data Acquisition Method Based on Lock-Free Buffer
  • A Data Acquisition Method Based on Lock-Free Buffer

Examples

Experimental program
Comparison scheme
Effect test

Embodiment

[0029] The fixed-length array is used to realize the heap (Heap), and the array becomes a balanced binary tree at this time. The first element of the array is the root of the tree, and the second and third nodes of the array are the left and right children of the tree, respectively. The index of such a tree is very convenient. If the index value of the current node is i, then its parent node is: iParent=floor((i-1) / 2); the left child node is: iLeftChild=2*i+1; The right child node is: iRightChild=2*i+2. The insertion process is a process of continuous heaping. Each time a node is inserted and a node is deleted at the same time, not only can the relative order of the elements be kept, but also there is no need to explicitly delete the elements.

[0030] The data structure of the lock-free heap is shown in the code LockFreeHeap, which contains a constant array and the variable N that maintains the modified state, and the length of the array LEN. The lock-free heap allocates con...

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 discloses a data acquisition method based on a lock-free buffer, which includes: using an object-oriented method to abstract data logic, establishing a producer-consumer data acquisition model; using multi-thread technology, establishing a data producer thread and consumer Or thread; use the ordered heap as a data buffer for multi-thread synchronization; use CAS atomic operation to build a lock-free synchronization algorithm for data reading and writing in the data buffer. The invention uses the producer-consumer buffer to realize orderly data arrangement, and can realize synchronous access of two parts of threads without data pollution and conflict in a lock-free manner.

Description

technical field [0001] The invention relates to the field of computer applications, in particular to a data collection method based on a lock-free buffer. Background technique [0002] In the traditional concurrent data acquisition system, using the lock-based producer-consumer buffer queue model, only one thread can obtain the data queue buffer at the same time. The lock-based data structure can partially solve the problem of multi-thread concurrency, but because the lock structure itself depends on the implementation of the operating system kernel, the acquisition and release of the lock design thread context switching from user mode to kernel mode, and the size of the lock granularity It is difficult to control, so performance problems in concurrent programs are gradually revealed. [0003] Blocking algorithms try to use different forms of locks (Lock) to solve the access conflicts encountered by parallel algorithms, but this method has various problems such as deadlock,...

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/52
Inventor 王友钊黄静
Owner ZHEJIANG UNIV
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