Method and apparatus for atomically accessing a queue in a memory structure where LIFO is converted to FIFO
AssigneeApple Computer, Inc.
InventorsPhilip M. Rakity, Mark D. Rustad
Life of this patent
Estimating the term…
Loading patent…
AssigneeApple Computer, Inc.
InventorsPhilip M. Rakity, Mark D. Rustad
Estimating the term…
A method and apparatus for storing and retrieving data from a queue implemented on a computer system. A queue memory structure is allocated in a memory device, the queue including a a last-in-fast-out (LIFO) and a first-in-first-out (FIFO). A data element is atomically added to the LIFO when the data element is enqueued to the queue structure, and a data element is atomically removed from the FIFO when the data element is to be dequeued from the queue, thus preventing concurrent processes from disordering the data in the queue. When the FIFO becomes empty, the LIFO is converted to a new FIFO, and this new FIFO is stored in place of the old (empty) FIFO. In one embodiment, a lock is set and the LIFO is converted to a new FIFO only when the lock is previously determined to be clear to prevent additional dequeuers from interrupting a dequeuing process. A high-priority data element can be atomically added to a head list that stores the data element at the front of the queue memory structure. The present invention allows multiple enqueuers and dequeuers on one or more processing elements, including interrupt handlers and other programs, to access the queue without altering interrupt levels and without risk of deadlock.
A method for storing and retrieving data from a queue implemented on a computer system, the method comprising:
A computer apparatus with a queue memory structure comprising:
A method for enqueuing and dequeuing data on a computer system comprising the steps of:
A computer system for providing a queue memory structure, the system comprising:
A computer readable medium including program instructions for storing and retrieving data from a queue memory structure, wherein a plurality of enqueuers and at least one dequeuer have access to said queue memory structure, said program instructions performing steps comprising:
A queue memory structure accessible by a plurality of enqueuers and dequeuers implemented in a computer system, the queue memory structure comprising:
Dependencies are inferred from the claim text.