Re: [RFC, 2.6] a simple FIFO implementation

From: Paul Jackson
Date: Thu Sep 16 2004 - 09:01:29 EST


This still has a 'size' attribute. As Andrew noted,
this might not be needed.

See for example:

http://cse.stanford.edu/class/cs110/handouts/27Queues.pdf

for coding a fifo queue with just a put and get pointer.

The queue is empty if put == get, and it is full if adding one more
would make it empty. The number of elements in the queue can be done
using modulo arithmetic on the difference between put and get (or what
the above *.pdf file and your code calls head and tail), with no
distinct 'size' element. The head and tail wrap.

--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@xxxxxxx> 1.650.933.1373
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/