Google Answers Logo
View Question
 
Q: operating systems ( Answered,   0 Comments )
Question  
Subject: operating systems
Category: Miscellaneous
Asked by: sumavind-ga
List Price: $2.00
Posted: 13 Nov 2002 11:46 PST
Expires: 13 Dec 2002 11:46 PST
Question ID: 107039
Why would you expect improved performance using a double buffer rather
than a single buffer for I/O
Answer  
Subject: Re: operating systems
Answered By: maniac-ga on 13 Nov 2002 16:20 PST
 
Hello Sumavind,

Based on your question, I will assume that the "double buffer" refers
to the area of memory used by an application to transmit information,
and not memory used by the operating system. I will also assume you
are not doing extra data copies when implementing the double buffer -
that can often hurt performance.

The main concept with "buffered I/O" is to allow the application
program to continue to do useful work while previous I/O is in
progress. Using a display as an example...
  1 application draws the image for frame 1 into buffer A
  2 application starts display card to display buffer A
  3a application draws the image for frame 2 into buffer B
  3b display card draws the image with buffer A
  4 application starts display card to display buffer B
  5a application draws the image for frame 3 into buffer A
  5b display card draws the image with buffer B
and the last few steps are repeated for each pair of display images.
Note that the steps 3a and 3b are done at the same time; the same for
steps 5a and 5b.

The same type of processing can take place for network I/O, disk I/O
and other devices. Note that many applications are not written this
way. They use I/O operations that block the application until the I/O
is complete. In this case, more than one buffer will not improve
performance of that application.

A few pages that describe related concepts include:

Open GL FAQ
  http://www.bergen.org/AAST/ComputerAnimation/Help_FAQs_OpenGL3.html
(has a description of switching between single and double buffered
modes)

Reusable Software Double Buffer
  http://research.compaq.com/SRC/juno-2/papers/dblbuffer/
(see also caution about performance penalty with copying data)

Mac OS X Quickdraw Performance
  http://developer.apple.com/technotes/tn/tn2051.html
(notes that the OS does double buffering for you, don't put it into
the application)

Advanced Circual Buffer
  http://www.ueidaq.com/appstories/appstories.asp?type=1&MM_recordId=7
(describes single and multiple buffer methods for data acquisition)

Some good search phrases include:
  "double buffer" performance

  --Maniac
Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy