I need to answer this question as soon as possible. Please give me your ideas.
The following class is a synchronous circular buffer. It is intended to have a fixed storage size, and it should block the producer thread when full, and the consumer thread when empty.
It makes use of the boost thread library for mutex locking.
• Describe the major problems with this class
• When might you use a class like this.
• Correct the class.
• Show that your solution is correct especially testing boundary conditions.
// This provides uint32_t (although perhaps not on your compiler)
template <typename T, uint32_t max>