Sample Video Frame

Created by Zed A. Shaw Updated 2024-12-10 18:57:40
 

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.

View Source file liblcthw/src/lcthw/ringbuffer.h Only

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.