Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/28/03 19:55
Read: times


 
#53595 - RE: circular queue module
Responding to: ???'s previous message
My understanding is that the terms "circular buffer" and "circular queue" are interchangeable
I would agree
I know that adding in the capability to modify an entry (e.g. to update an occurence count) and the capability to work on a limited portion of the entries (e.g. displaying only a screenful of entries somewhere in the middle of the list) are not a typical circular queue activities, so does this mean that my system is not really a circular queue and is instead something else entirely?

The ONLY non-convoluted use of a circular buffer is to have a write pointer that wraps and the ONLY means of writing is to write where the write pointer points and update the write pointer.

This way, the first entry after the write pointer is the oldest and the newest entry end at the write pointer.

So, if you want to "update an occurence count" you do not "update" it, you just write the new count.

e.g. displaying only a screenful of entries somewhere in the middle of the list
I do not see where your application would want to do so.

Due to the nature of a circular buffer checksumming of the entire buffer is extremely impractical, you can, should you wish, checksum individual entries.

solutions
1) as far as I can see the only thing you have that really warrants a circular buffer is the error logging. If so, why not store the rest in fixed locations and have a circular buffer for error logging only.
or
2) make all records the same length
or
3) start all records with a "record mark" and when reading from the write pointer ignore info till a record mark is found.

Erik

List of 13 messages in thread
TopicAuthorDate
circular queue module            01/01/70 00:00      
   RE: circular queue module            01/01/70 00:00      
   RE: circular queue module            01/01/70 00:00      
      RE: circular queue module            01/01/70 00:00      
      RE: circular queue module            01/01/70 00:00      
         RE: circular queue (logging module)            01/01/70 00:00      
            RE: circular queue (logging module)            01/01/70 00:00      
               RE: clarification            01/01/70 00:00      
               RE: circular queue (logging module)            01/01/70 00:00      
                  RE: circular queue (logging module)            01/01/70 00:00      
                     RE: circular queue (logging module)            01/01/70 00:00      
   RE: circular queue module            01/01/70 00:00      
   RE: circular queue module            01/01/70 00:00      

Back to Subject List