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

Ring buffer read-write method and device

A technology of ring buffer and read-write method, which is applied in the direction of multi-program device, program synchronization, inter-program communication, etc., can solve the problem of low read-write efficiency and achieve the effect of improving read-write efficiency

Pending Publication Date: 2021-07-02
张荣晋
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] The embodiment of the present application provides a ring buffer reading and writing method and device to at least solve the problem in the prior art that only one user can perform the same operation on the ring buffer at a time, resulting in low read and write 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
  • Ring buffer read-write method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0019] It should be noted that, in the case of no conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and embodiments.

[0020] It should be noted that the steps shown in the flowcharts of the accompanying drawings may be performed in a computer system, such as a set of computer-executable instructions, and that although a logical order is shown in the flowcharts, in some cases, The steps shown or described may be performed in an order different than here.

[0021] In this embodiment, a ring buffer reading and writing method is provided, figure 1 It is a flow chart of the ring buffer reading and writing method according to the embodiment of the present application, such as figure 1 As shown, the process includes the following steps:

[0022] Step S102, obtaining the length N of the ring buffer, where the ...

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 ring buffer read-write method and device, and the method comprises the steps that the length N of a ring buffer is obtained, the length N of the ring buffer identifies that N elements exist in the ring buffer, and the address intervals between the adjacent elements of the ring buffer are the same; the ring buffer is divided into M groups, and address intervals between adjacent elements in each group of the M groups are the same; the M groups are respectively used as sub-ring buffers of the ring buffer, each group is a sub-ring buffer, and the number of the sub-ring buffers is M; and read operation or write operation is performed on one or more of the M sub-ring buffers. According to the method and the device, the problem of low read-write efficiency caused by the fact that only one user performs the same operation on the ring buffer in the prior art is solved, and the read-write efficiency of the ring buffer is improved to a certain extent.

Description

technical field [0001] This application relates to the field of software, in particular, to a method and device for reading and writing a ring buffer. Background technique [0002] In programs (for example, communication programs), ring buffers are often used as data structures to store data sent and received in communication. A ring buffer is a first-in, first-out circular buffer that provides mutually exclusive access to the buffer to the communicating program. [0003] A ring buffer usually has a read pointer and a write pointer. The read pointer points to the readable data in the ring buffer, and the write pointer points to the writable buffer in the ring buffer. Data reading and writing of the buffer can be realized by moving the read pointer and the write pointer. Under normal circumstances, the read user of the ring buffer only affects the read pointer, and the write user only affects the write pointer. If there is only one reader and one writer, then the correctn...

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
IPC IPC(8): G06F9/54G06F9/52G06F12/02
CPCG06F9/544G06F9/526G06F12/0238
Inventor 张荣晋
Owner 张荣晋
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