Welcome, Guest. Please login or register.

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

Description:

0 Members and 1 Guest are viewing this topic.

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show all replies
Buffers in general and this case....
« on: June 07, 2004, 05:41:41 PM »
Ok, I must admit I never read almost anything about them, but I just would like your opinions on this...

I want to receive some data over (say the serial devivce for example) and store it somewhere. Then analyse it and depending on the result do some action or get the next unit of data to repeat the process. The analysis I want to make compares the data with the previous one.

Two main doubts:

1- At some point when the buffer gets filled it has to return to the initial address again right? So the code should expect that special case... Kinda like this: Successively fill each buffer space corresponding to the size of the data I'm receiving starting at the lowest address of the buffer. Then compare each one with the previous one as it gets filled. When reach end of buffer start filling buffer from the start address again and compare the last buffer data with the first one (the special case).
This buffer would have the advantage of when analysis of data gets more slow it would still be getting data (filling the buffer), maybe with DMA (?). When it's the data comming in that gets slow I'd already have a buffer to compensate.
If this doesnt make sense at all let me know too:-D

2- Since, just for now, for experimenting, I'm using an already existing DOS program to get the data from the serial port, and it saves it on a file, should I use the ramdisk to store the files in succession and then compare them? I guess that's the only choice anyway.

3- Ok just by curiosity, isn't that the way buffers work in general anyway?...

Thx for the patiente... 8-)
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show all replies
Re: Buffers in general and this case....
« Reply #1 on: June 08, 2004, 09:47:34 AM »
"...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."

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  

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

Thx. Not for now. I'll return to the thread later...

 
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show all replies
Re: Buffers in general and this case....
« Reply #2 on: June 09, 2004, 06:42:15 PM »
@Noster
Cool, I'll take the advice and read something about the Amiga's PIPE when I have more time...

@Sidewinder
It would be cool to belive that, but even if it was true, as a compensation my lazyness beats that by ten fold easily :-D

\\"We made Amiga, they {bleep}ed it up\\"