Data collection method based on lock-free buffer region

A data acquisition and buffer technology, applied in the direction of program synchronization, multi-program device, etc., can solve the problems of relying on the number of threads, a large number of tasks, and few applications

Active Publication Date: 2015-07-29
ZHEJIANG UNIV
View PDF2 Cites 16 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
  • Data collection method based on lock-free buffer region
  • Data collection method based on lock-free buffer region

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 this 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 all...

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 collection method based on a lock-free buffer region. The method comprises the following steps that a data logic is abstracted by an object-oriented method, and a producer-customer data collection model is built; a multi-thread technology is used, a data producer thread and a customer thread are built; an orderly pile is used as a data buffer region of multi-thread synchronization; a CAS atomic operation is used for building the lock-free synchronization algorithm of the data reading and writing in the data buffer region. The data collection method has the advantages that the producer-customer buffer region is used for realizing the ordered data ranging, and in addition, the synchronization access of the threads of the two parts without data pollution and conflict can be realized in a lock-free mode.

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-threaded 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 lock granularity The size 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, liv...

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): 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