Data reading and writing method and device, and circle queue
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Publication Date
- 2018-11-02
Smart Images

Figure 1 
Figure 2 
Figure 3
Abstract
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...