Patent attributes
A method and apparatus for providing multiple queues that share a single memory buffer. A memory buffer is divided into a plurality of fixed length memory segments. Queues are created by chaining one or more memory segments together. Memory segments are allocated on a dynamic basis when needed by a queue. Multiple queues are created wherein each queue consists of a set of one or more memory segments. A list is used to track the memory segments making up a queue. The pointers to the memory segments are stored in a pointer table or a linked list termed a next segment pointer table. Multiple queues are handled by creating multiple linked lists, one for each queue. Each memory segment has associated with it a corresponding next segment pointer. A segment pointer is assigned to each memory segment and is adapted to contain the address of the next segment in the queue. A segment status table comprises bits corresponding to different memory segments that indicate whether a segment is currently available or is occupied as part of a queue. The next segment pointers and status bits are updated dynamically in accordance with read, write, flush and status commands.