Circular queue

David Hawkins dwh at
Fri Jul 27 05:55:11 EST 2007

David H. Lynch Jr. wrote:
>     Is there a standard linux datastructure and routines to manage
> circular queues ?
>     I have a device that is not fundimentally different from a serial
> character device
>     except it is faster and the fundimental data type is 36 bits large.
>     I have coded my own routines to setup and maintain a simple circular
> queue,
>     but I was hoping that there might be something more standard that
> already exists.
>     Anyone know of anything ?

Hi David,

Have you looked at the linked-list support? You can use it
for a circular queue.

I just copied the following comments from some driver examples
I wrote a while back:


  * References:
  * [1] "Linux device drivers", 3rd Ed, J. Corbet, A. Rubini,
  *      G. Kroah-Hartman, 2005
  * [2] "Linux kernel development", 2nd Ed., R. Love.

  * For details on linked-lists, see p295 [1] and p345 [2].

I didn't look at the code again, but I'm pretty sure I used the
linked list for a circular buffer.


More information about the Linuxppc-embedded mailing list