摘要 |
A data queue system comprises plural memory blocks defined in memory and a data queue, which comprises a number of memory blocks each including a link to the following block in the data queue. A queue descriptor is stored in memory. It comprises information identifying the following: the final block in the queue, the memory location where the most recent read commit occurred, and an offset from a predetermined location in that memory block, the memory location where the most recent write commit occurred, and an offset from a predetermined location in that memory block, the size of the memory blocks, the memory location where the most recent write occurred, the number of unused blocks associated with the data queue, the number of memory blocks associated with the data queue which contain data to be read, the type of data queue, the memory location where the most recent read occurred, and the number of memory blocks which have been read since the most recent read commit. A method of managing data stored in a queue in memory comprises reading data from a head of the queue, updating the position of a latest read pointer to a location corresponding to the end of the data, transferring the data to a destination, and updating the position of a committed read pointer to a location corresponding to the end of the data upon receiving confirmation that the data transfer was successful. When there is insufficient data in the queue to meet a continuous-flow demand, the most recently read data is re-read.
|