On Fri, 18 Mar 2005 13:07:39 +0100, Attila Kinali <[EMAIL PROTECTED]> wrote:
> > Do you grok the concept of a ring buffer?
> 
> Looks like i do not.
> Are there any good docu/webpages/books to read about this stuff ?
It's data structure stuff.  Try to find books like "Fundamentals of Data 
Structures in C++" or " Fundamentals of Data Structures in Java"..
"Head" could possibly mean "the reader",  and "Tail" could possibly mean
"the writer".  Suppose the ring buffer is 32 bytes big. 

char ring_buffer[32];
reader_val;
int i =0;
while(1)
{
   reader_val = ring_buffer[i];
   i = (i+1)%32;
}

As you see, "the reader" reads the rinng buffer in a circular way. So it's
the same with "the writer".

"The reader" consumes data while "the writer" produces/provides
data. If "the reader"  catch up with "the writer",  buffer-underrun occurs.
If "the writer" catch up with "the reader", buffer overrun occurs. So
"the reader"
and "the writer" can't meet together (Can't point to the same location
of the ring buffer).

-- 
The sun is shinny but the ice is slippery.
_______________________________________________
Open-graphics mailing list
[email protected]
http://lists.duskglow.com/mailman/listinfo/open-graphics
List service provided by Duskglow Consulting, LLC (www.duskglow.com)

Reply via email to