Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Data writing method, device, terminal device and computer storage medium of circular queue

A circular queue and data writing technology, which is applied to multi-channel program devices, electrical digital data processing, program control design, etc., can solve the problems of low data writing efficiency and other issues

Active Publication Date: 2018-10-26
SHENZHEN EXCELSECU DATA TECH
View PDF7 Cites 11 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] In the above method, when multiple threads write data at the same time, it is necessary to perform two competition operations of the CAS mechanism, and each thread will repeat the competition after the competition fails, which will lead to low data writing efficiency

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 writing method, device, terminal device and computer storage medium of circular queue
  • Data writing method, device, terminal device and computer storage medium of circular queue
  • Data writing method, device, terminal device and computer storage medium of circular queue

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0026] In the following description, specific details such as specific system structures and technologies are presented for the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of the present invention. It will be apparent, however, to one skilled in the art that the invention may be practiced in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.

[0027] Embodiments of the present invention provide a data writing method, device, terminal device, and computer storage medium for a circular queue, which can improve the data writing efficiency of the circular queue.

[0028] see Figure 1a , the first embodiment of a data writing method of a circular queue in the embodiment of the present invention includes:

[0029] 101. When any thread is ab...

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 storage, and provides a data writing method, a device, a terminal device and a computer storage medium of a circular queue. The data writing methodcomprises the following steps: when any thread is ready to write data to a circulating queue, judging whether other threads are currently writing data to the circulating queue; If other threads are currently writing data to the circular queue, returning to the step of judging whether other threads are currently writing data to the circular queue and subsequent steps after the preset time length;If no other thread is currently writing data to the circular queue, each thread competing for a first pointer using atomic operation of a compare and swap mechanism, the first pointer pointing to thenext writable data location in the circular queue; and writing data to the circular queue by a thread that successfully competes for the first pointer. The method can effectively improve the data writing efficiency of the circulating queue.

Description

technical field [0001] The present invention relates to the technical field of data storage, in particular to a data writing method, device, terminal equipment and computer storage medium of a circular queue. Background technique [0002] Logically connecting the head and tail of the array will form a circular queue. The lock-free circular queue implements a mechanism that allows users to write data to the queue in a circular manner without considering the problem of the queue being full. [0003] At present, the data writing method of the lock-free circular queue is generally: each thread uses CAS (Compare and Swap), that is, the atomic operation mode of the comparison and exchange mechanism competes and advances the first pointer (the first pointer points to the next writable queue in the queue) If the competition fails, the competition will continue. If the competition succeeds, the corresponding write position will be obtained, and then the corresponding data will be wr...

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/48G06F9/54
CPCG06F9/4881G06F9/546G06F2209/548
Inventor 陈柳章
Owner SHENZHEN EXCELSECU DATA TECH
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products