DSPRelated.com
Forums

difference between double buffering and FIFO

Started by Unknown May 26, 2005
What is the difference between double buffering and FIFO ?
can I say double buffering is nothing but FIFO of deoth 2.

junky_fellow@yahoo.co.in writes:

> What is the difference between double buffering and FIFO ? > can I say double buffering is nothing but FIFO of deoth 2.
What's "deoth"? I take double buffering to mean that you have two buffers (i.e., multi-word memory areas, say, of length M words), and that the first buffer is being filled while the second one is operated upon, or the first one is operated upon while the second one is being output. In either buffer, you operate a buffer at a time (M words at a time). At some point a transfer of M words from the first buffer to the second buffer occurs. Contrast this to a FIFO which is a word-oriented device. Only one word at a time is transferred, whether inputting words to the device or retrieving words from it. So yes, they are different. -- Randy Yates Sony Ericsson Mobile Communications Research Triangle Park, NC, USA randy.yates@sonyericsson.com, 919-472-1124
I think he meant "depth".  And while I tend to use your definition of double 
buffering more often, I bet he is referring to some I/O device (like a uart) 
that has double buffers on the tx or rx side.  In these terms, these are 
sort of like FIFOs in that you write to a tx register and the device has 
"double buffers" so that it moves that immediately to an internal tx buffer 
so you can write the next word while the current one is being transmitted.

"Randy Yates" <randy.yates@sonyericsson.com> wrote in message 
news:xxpvf56f9rw.fsf@usrts005.corpusers.net...
> junky_fellow@yahoo.co.in writes: > >> What is the difference between double buffering and FIFO ? >> can I say double buffering is nothing but FIFO of deoth 2. > > What's "deoth"? > > I take double buffering to mean that you have two buffers (i.e., > multi-word memory areas, say, of length M words), and that the first > buffer is being filled while the second one is operated upon, or the > first one is operated upon while the second one is being output. In > either buffer, you operate a buffer at a time (M words at a time). At > some point a transfer of M words from the first buffer to the second > buffer occurs. > > Contrast this to a FIFO which is a word-oriented device. Only one word > at a time is transferred, whether inputting words to the device or > retrieving words from it. So yes, they are different. > -- > Randy Yates > Sony Ericsson Mobile Communications > Research Triangle Park, NC, USA > randy.yates@sonyericsson.com, 919-472-1124
junky_fellow@yahoo.co.in wrote:
> What is the difference between double buffering and FIFO ? > can I say double buffering is nothing but FIFO of deoth 2.
I would say no.
>
In a double buffer, you can access data in an arbitrary order. A FIFO is well, first in, first out. Some double buffers are switched. Some are controlled by semaphores.
how're ya doin', Ron?  it's good to see your name occasionally here.

in article 119bkeo7rjpj5b9@corp.supernews.com, Ron Huizen at
rhuizen@bittware.com wrote on 05/26/2005 09:42:

> I think he meant "depth".
very astute to see that, i could decode that either. i though the OP meant that double buffers are the FIFO from hell or something. i always attach emotional meaning.
> And while I tend to use your definition of double > buffering more often, I bet he is referring to some I/O device (like a uart) > that has double buffers on the tx or rx side. In these terms, these are > sort of like FIFOs in that you write to a tx register and the device has > "double buffers" so that it moves that immediately to an internal tx buffer > so you can write the next word while the current one is being transmitted.
one thing i might add is that a FIFO of twice the length is the same as a double buffer if you have a flag that tells you when the input or output pointer has crossed both the top of the buffer and the half-way mark. isn't that the case? the point is that in a double buffering context, you are guaranteed that the I/O is not molesting the buffer you are working on and you guarantee not to molest the buffer that the background I/O process is working on. sometimes you can do other useful work with the double buffer (if it is *not* the FIFO i mention above). you can have stereo or more channels interlaced in the I/O buffer and have them split up and de-interlaced in the buffers that the signal processing algorithm is working on. sorta like what we did at you-know-where, Ron. you can kill many birds with this single stone. scaling or reformating (from fixed to float) while you're passing data from the I/O buffer to the DSP buffer is another job. maybe even bit-reverse addressing if there is an FFT in there. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
"robert bristow-johnson" <rbj@audioimagination.com> wrote in message
news:BEBB7A27.7A4C%rbj@audioimagination.com...
> > in article 119bkeo7rjpj5b9@corp.supernews.com, Ron Huizen at > rhuizen@bittware.com wrote on 05/26/2005 09:42: > > > What is the difference between double buffering and FIFO ? > > can I say double buffering is nothing but FIFO of deoth 2. > > > I think he meant "depth". > > very astute to see that, i could decode that either. i though the OP meant > that double buffers are the FIFO from hell or something. i always attach > emotional meaning.
I think some people have an extra knack for "seeing through" typos and interpreting poorly written text. Sometimes co-workers ask me to interpret some poorly written text they can't understand, and I usually can figure it out. In my experience, very analytical/logical people sometimes have difficulty with this, getting stumped by the literal meaning. Perhaps it is a similar skill to being able to understand people with thick accents? I think experience helps with this a lot--after growing up in Seattle around people of various Asian nationalities, I found I could understand their accents better than a friend of my from Kansas, where Asians were few and far between.
in article 119c5jj72ucl508@corp.supernews.com, Jon Harris at
jon_harrisTIGER@hotmail.com wrote on 05/26/2005 14:35:

> "robert bristow-johnson" <rbj@audioimagination.com> wrote in message > news:BEBB7A27.7A4C%rbj@audioimagination.com... >> >> in article 119bkeo7rjpj5b9@corp.supernews.com, Ron Huizen at >> rhuizen@bittware.com wrote on 05/26/2005 09:42: >> >>> What is the difference between double buffering and FIFO ? >>> can I say double buffering is nothing but FIFO of deoth 2. >> >>> I think he meant "depth". >> >> very astute to see that, i could decode that either. i though the OP meant >> that double buffers are the FIFO from hell or something. i always attach >> emotional meaning. > > I think some people have an extra knack for "seeing through" typos and > interpreting poorly written text. Sometimes co-workers ask me to interpret > some poorly written text they can't understand, and I usually can figure it > out. In my experience, very analytical/logical people sometimes have > difficulty with this, getting stumped by the literal meaning. > Perhaps it is a similar skill to being able to understand people with thick > accents? I think experience helps with this a lot--after growing up in > Seattle around people of various Asian nationalities, I found I could > understand their accents better than a friend of my from Kansas, where > Asians were few and far between.
what's ironic is that i made two typos here, one of which changed the meaning of what i meant. i meant to say:
>> very astute to see that, i could NOT decode that either. i thoughT the OP >> meant that double buffers are the FIFO from hell or something. i always >> attach emotional meaning.
maybe i should run for public office (the socialist US Representative here in VT is gonna run for US Senate, maybe i can run for his office, won't that be cool to have a *true* pinko in the Senate?) because i can evidently get away with saying the opposite of what i mean. a useful gift for a politician. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
"robert bristow-johnson" <rbj@audioimagination.com> wrote in message
news:BEBB999B.7A62%rbj@audioimagination.com...
> in article 119c5jj72ucl508@corp.supernews.com, Jon Harris at > jon_harrisTIGER@hotmail.com wrote on 05/26/2005 14:35: > > > "robert bristow-johnson" <rbj@audioimagination.com> wrote in message > > news:BEBB7A27.7A4C%rbj@audioimagination.com... > >> > >> in article 119bkeo7rjpj5b9@corp.supernews.com, Ron Huizen at > >> rhuizen@bittware.com wrote on 05/26/2005 09:42: > >> > >>> What is the difference between double buffering and FIFO ? > >>> can I say double buffering is nothing but FIFO of deoth 2. > >> > >>> I think he meant "depth". > >> > >> very astute to see that, i could decode that either. i though the OP meant > >> that double buffers are the FIFO from hell or something. i always attach > >> emotional meaning. > > > > I think some people have an extra knack for "seeing through" typos and > > interpreting poorly written text. Sometimes co-workers ask me to interpret > > some poorly written text they can't understand, and I usually can figure it > > out. In my experience, very analytical/logical people sometimes have > > difficulty with this, getting stumped by the literal meaning. > > Perhaps it is a similar skill to being able to understand people with thick > > accents? I think experience helps with this a lot--after growing up in > > Seattle around people of various Asian nationalities, I found I could > > understand their accents better than a friend of my from Kansas, where > > Asians were few and far between. > > what's ironic is that i made two typos here, one of which changed the > meaning of what i meant. i meant to say: > > >> very astute to see that, i could NOT decode that either. i thoughT the OP > >> meant that double buffers are the FIFO from hell or something. i always > >> attach emotional meaning.
I read right through those typos too! :-) (Noticed the first and assumed you meant NOT from the context, didn't even notice the second one.) On the flip side, those who are good at reading through typos often make lousy proofreaders.
Randy Yates wrote:

>>What is the difference between double buffering and FIFO ? >>can I say double buffering is nothing but FIFO of deoth 2. > > What's "deoth"?
Orpbably the result of P and O being right next tp each pther pn the keybpard :-) Carlps --
Ron Huizen wrote:

> I think he meant "depth". And while I tend to use your definition of double > buffering more often, I bet he is referring to some I/O device (like a uart) > that has double buffers on the tx or rx side. In these terms, these are > sort of like FIFOs in that you write to a tx register and the device has > "double buffers" so that it moves that immediately to an internal tx buffer > so you can write the next word while the current one is being transmitted.
But I think Randy's distinction still makes sense for those, given that for a UART, individual bits are the equivalent of what Randy referred to as "words", and the entire register would be the "block of words" (the block of bits). The "output" block of bits is necessary -- and can not be touched -- until the very last bit has been sent; yet, there is not enough time to fill it in after the last bit was sent and before the time when the next bit (first bit of next block) should/must be sent -- double buffer is the magic solution. I do think that you can state (at least informally speaking) that a double-buffer is a FIFO of depth 2 -- only that it's a FIFO with a very specific purpose, very specific rationale, and hence with certain additional requirements and features with respect to a "general purpose" FIFO. Carlos --