65.9K
CodeProject is changing. Read more.
Home

Circular Buffer

starIconstarIconstarIconstarIconemptyStarIcon

4.00/5 (1 vote)

Jun 16, 2001

viewsIcon

67102

downloadIcon

1607

A multi-threaded circular buffer program

Sample Image - circbuf.gif

Overview

I recently needed a class that performed both a read and write operation to a queue. I started searching for such a class, and I found one here at Code Project. I made several changes to the application. First, I converted the program from console application to an MFC SDI application using a CListView for displaying the data (see screenshot). Next, I simplified the thread synchronization process by sending a user defined window message. And finally, I added a performance timer (also found here at Code Project) which measures the time required to execute the program using different queue sizes. For specific details on how the queue portion of the program works reference David Hubbard's Circular Buffer article. I have included a small demonstration application in a project called Circbuf. It is multithreaded MFC SDI application using VC6.