D
D
Danil Tunev2021-02-11 18:44:12
IT terminology
Danil Tunev, 2021-02-11 18:44:12

What does the concept of "ring buffer" tell you?

Long, long thought and finally matured). What mathematical model would you suggest so that it fills with a, then fills up again?

Answer the question

In order to leave comments, you need to log in

6 answer(s)
A
Andrey Ezhgurov, 2021-02-11
@lada-guy

Banal array of length Len
Index of the next element: Index = (Index + 1) % Len
Index of the previous element: Index = (Index + Len - 1) % Len
Add to the head, read from the tail - accordingly, the buffer contains two indices: Head and Tail .
If the head catches up with the tail, the buffer is full.
If the tail caught up with the head, the buffer is empty.

G
Griboks, 2021-02-11
@Griboks

I would suggest widely known and well-studied models: one or two .

A
Armenian Radio, 2021-02-11
@gbg

Producer-consumer

D
Developer, 2021-02-11
@samodum

>>>
Stack overflow

V
Vladimir Korotenko, 2021-02-11
@firedragon

Create an array of fixed size.
methods push and pop
Push increments the pointer, when it reaches the top it jumps to the beginning.
Pop simply returns the current pointer or the current pointer minus the number of samples.
This is for values
. For video, record in chunks of 2 mb in memory, store only the name and date. If you have exhausted the card limit, then delete the old files until there is enough space to record a new chunk.

W
Wataru, 2021-02-12
@wataru

The ring buffer is a queue with a limited size. Queue models are well known.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question