Data reading and writing method and device, and circle queue

A ring queue, data reading and writing technology, applied in data conversion, electrical digital data processing, data processing input/output process, etc., can solve the problems of large memory consumption and low data transmission efficiency
CN108733344AActive Publication Date: 2018-11-02

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Publication Date
2018-11-02

Smart Images

  • Figure 1
    Figure 1
  • Figure 2
    Figure 2
  • Figure 3
    Figure 3
Patent Text Reader

Abstract

The invention provides a data reading and writing method, a data reading and writing device and a circle queue. The method comprises the steps of acquiring a deviation position of a writing pointer from a queue head of the circle queue; determining a deviation position of a reading pointer according to the deviation position of the writing pointer; and reading data from the circle queue accordingto the deviation position of the reading pointer. According to the data reading and writing method, the data reading and writing device and the circle queue, single-input multi-output of a shared memory is implemented so that multiple reading threads can read data from the circle queue in parallel, thus the data reading and writing efficiency is effectively improved and the memory consumption is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

technical field

[0001] The invention relates to the technical field of data storage, in particular to a data reading and writing method, device and ring queue. Background technique

[0002] A queue is a storage structure capable of implementing "first in first out" (FIFO). Queues are divided into ordinary queues and ring queues. Ordinary queues are generally composed of arrays, and data is accessed according to the first-in-first-out processing method. There is no circular structure in the memory, so the circular queue is actually realized by the linear space of the array.

[0003] The ring queue logically connects the array elements q[0] and q[MAXN-1] to form a ring space for storing the queue. In order to facilitate reading and writing, the array subscript is also used to indicate the reading and writing position of the queue. For example head / tail, where head points to a location that can be read, and tail points to a location that can be written.

[0004] Although t...

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