QUEUES

12/2/2002

Queues: Two types of queues are widely used in hardware and software. A buffer is a First-In, First Out (FIFO) Queue. A stack is a Last In-First Out (LIFO) Queue. A third entity -- a Dequeue from which entries can be removed either first or last is also used occasionally.

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-2002 by Donald Kenney.