User:Nierwen/Búffer múltiple

From Wikipedia, the free encyclopedia

En informática un 'Búffer múltiple es el uso de más de un buffer para el almacenamiento de un bloque de datos. Si estos datos están siendo leídos y escritos al mismo tiempo, un búffer múltiple permite al "lector" obtener una visión completa de los datos (aunque no esté actualizada), en vez de tener una versión parcialmente actualizada de los datos que están siendo creados por el "escritor". También se usa para evitar la necesidad de usar ram de doble puerto cuando los lectores y escritores son diferentes dispositivos.

Descripción[edit]

The easiest way to explain how multiple buffering works is to take a real world example. It is a nice sunny day and you have decided to get the paddling pool out, only you can not find your garden hose. You'll have to fill the pool with buckets. So you fill one bucket (or buffer) from the tap (or faucet), turn the tap off, walk over to the pool, pour the water in, walk back to the tap to repeat the exercise. This is analogous to single buffering. The tap has to be turned off while you "process" the bucket of water.

Now consider how you would do it if you had two buckets. You would fill the first bucket and then swap the second in under the running tap. You then have the length of time it takes for the second bucket to fill in order to empty the first into the paddling pool. When you return you can simply swap the buckets so that the first is now filling again, during which time you can empty the second into the pool. This can be repeated until the pool is full. It is clear to see that this technique will fill the pool far faster as there is much less time spent waiting, doing nothing, while buckets fill. This is analogous to double buffering. The tap can be on all the time and does not have to wait while the processing is done.

If you employed another person to carry a bucket to the pool while one is being filled and another emptied, then this would be analogous to triple buffering. If this step took long enough you could employ even more buckets, so that the tap is continuously running filling buckets.

In computer science the situation of having a running tap that cannot be, or should not be, turned off is common (such as a stream of audio). Also, computers typically prefer to deal with chunks of data rather than streams. In such situations double buffering is often employed.


References[edit]

External links[edit]