|Modulo n arithmetics email@example.com (Christian Fabre) (1992-11-06)|
|Re: Modulo n arithmetics firstname.lastname@example.org (1992-11-10)|
|Re: Modulo n arithmetics email@example.com (David R. Clark) (1992-11-11)|
|Re: Modulo n arithmetics firstname.lastname@example.org (1992-11-11)|
|Modulo n arithmetics email@example.com (1992-11-11)|
|Re: Modulo n arithmetics wendt@CS.ColoState.EDU (1992-11-15)|
|Re: Modulo n arithmetics firstname.lastname@example.org (1992-11-17)|
|Re: Modulo n arithmetics email@example.com (1992-11-19)|
|Re: Modulo n arithmetics tve@crackle.CS.Berkeley.EDU (1992-11-20)|
|Re: Modulo n arithmetics firstname.lastname@example.org (1992-11-29)|
|From:||wendt@CS.ColoState.EDU (alan l wendt)|
|Organization:||Colorado State University, Computer Science Department|
|Date:||Sun, 15 Nov 1992 16:39:06 GMT|
Speaking of modulo-n buffering systems. This is really the wrong group
but I cannot help mentioning that the traditional head-and-tail pointer
technique for circular buffering is the wrong way to do it. The problem
is that head==tail can mean that the queue is empty or that the queue is
full, so most implementations waste a queue entry so that the queue never
really gets full.
If the algorithm maintains the queue head pointer and the queue length,
instead of head and tail, the two cases can be disambiguated easily!
Horowitz & Sahni (Fundamentals of Computer Algorithms) suggest that one
might maintain an additional boolean to disambiguate the two situations,
which I take as evidence that this idea is not widely disseminated.
Return to the
Search the comp.compilers archives again.