Welcome, Guest. Please login or register.

Author Topic: Buffers in general and this case....  (Read 2146 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Sidewinder

  • Full Member
  • ***
  • Join Date: Mar 2002
  • Posts: 241
    • Show all replies
    • http://www.liquido2.com
Re: Buffers in general and this case....
« on: June 08, 2004, 12:40:11 AM »
In general a buffer is simply a temporary storage place for data before it is processed.  Most buffers act just like a queue, that is "first in, first out" (FIFO).  The way this is actually accomplished depends on the implementation.

Some buffers are created using linked lists.  This offers the most flexability, but it uses more memory.

If a large block of memory is reserved as the buffer (such as an array) then a strict FIFO implementation would be quite slow because memory would have to be shifted each time data is added to the buffer.

The solution that you describe would be more complex but would be much faster than the strict FIFO implementation and use less memory than the linked list.

Let me know if you have any questions or would like some code examples.

Sidewinder
 

Offline Sidewinder

  • Full Member
  • ***
  • Join Date: Mar 2002
  • Posts: 241
    • Show all replies
    • http://www.liquido2.com
Re: Buffers in general and this case....
« Reply #1 on: June 08, 2004, 08:05:11 PM »
Quote
Wow! Just comes to prove that even when one doesn't know anything about what already is out there sometimes one also can make cool stuff:-D


Yes!  Now, to be honest, it isn't a totally new idea, but for someone who doesn't deal with algorithems very often it shows a great aptitude for creative problem solving.  You can go far in the world of programming with a thought process like that!

Sidewinder