Sample Video Frame

Created by Zed A. Shaw Updated 2024-02-17 04:54:36

Exercise 44: Ring Buffer

Ring buffers are incredibly useful when processing asynchronous I/O. They allow one side to receive data in random intervals of random sizes, but feed cohesive chunks to another side in set sizes or intervals. They are a variant on the Queue data structure but focus on blocks of bytes instead of a list of pointers. In this exercise, I'm going to show you the RingBuffer code, and then have you make a full unit test for it.

Previous Lesson Next Lesson

Register for Learn C the Hard Way

Register today for the course and get the all currently available videos and lessons, plus all future modules for no extra charge.