Buffers are primarily used to synchronize processes with different timing requirements where processing each entry as it is received is not practical.
Stacks are widely used in software and, to a lesser extent, in hardware. In particular, addresses of interrupts and subroutine call returns are generally placed on stacks since that allows returns of control to be done simply by removing and using the top value on the stack.
An advantage of stacks is that they greatly simplify managing the visibility of variables because variables stored on the stack are visible to routines that should be able to see them and invisible to those who should not when conventional formal visibility rules are followed.
Return To Index Copyright 1994-2008 by Donald Kenney.