Method, device and digital-television receiving terminal for realizing ring buffer

A ring buffer and numerical technology, applied in the direction of TV, color TV, electric digital data processing, etc., can solve the problem of performance degradation, and achieve the effect of avoiding the degradation of system performance

Inactive Publication Date: 2010-08-11
SHENZHEN COSHIP ELECTRONICS CO LTD
View PDF0 Cites 35 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

This reduces

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
  • Method, device and digital-television receiving terminal for realizing ring buffer
  • Method, device and digital-television receiving terminal for realizing ring buffer
  • Method, device and digital-television receiving terminal for realizing ring buffer

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0022] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings.

[0023] figure 1 It is a schematic flowchart of an embodiment of a method for implementing a ring buffer in the present invention, and the method includes the following steps:

[0024] 100. When reading data, judge whether the current read pointer value of the ring buffer is equal to the current write pointer value, if the judgment is yes, return empty, and end the process, if the judgment is no, read the current reading of the ring buffer The data in the storage space pointed to by the pointer is increased by one after the read operation is performed;

[0025] 101. When writing data, when the current write pointer value of the ring buffer is greater than the current read pointer value, subtract the current write pointer value of the ring buffer from the current read p...

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 embodiment of the invention discloses a method for realizing a ring buffer, which comprises the following steps: when reading data, judging whether the value of a current read pointer of the ring buffer is equal to the value of the current write pointer, if so, returning to null, otherwise reading data in the storage space pointed by the current read pointer of the ring buffer, and adding 1 to the value of the current read pointer after the read operation is carried out; and when writing data, subtracting the value of the current write pointer of the ring buffer from the value of the current read pointer, and judging whether the difference after the subtraction is less than the maximum storage value of the ring buffer, if so, writing the data into the storage space pointed by the current write pointer of the ring buffer and adding 1 to the value of the current write pointer after the write operation is carried out, otherwise returning to full. The invention can maximally utilize the message space of the ring buffer without degrading the system performance.

Description

Technical field [0001] The present invention relates to the field of electronic communication, in particular to a method and device for realizing a ring buffer. Background technique [0002] The ring buffer is one of the most commonly used data structures, and under certain restrictions, it is a lock-free data structure. And the ring buffer is simple to implement, has high performance, and is widely used. [0003] In the prior art, there are mainly two ways to use the ring buffer. One is to reserve a space for use to distinguish between empty and full states. For example, the size of a ring buffer is N and the write pointer is W. , The read pointer is R, then this buffer can only hold N-1 messages at most. The condition for the buffer to be empty is that W is equal to R, and the condition for the buffer to be full is (W+1)% N is equal to H, this method There is a shortcoming that will waste a message space, when the message is relatively large, it will cause a waste of space. An...

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): H04N5/44G06F3/06
CPCG06F5/14H04N21/40
Inventor 喻欣
Owner SHENZHEN COSHIP ELECTRONICS CO LTD
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