https://en.wikipedia.org/wiki/Multiple_buffering
Simple,Correct,Efficient And Ready To Use Implementation Of MultipleBuffering In C++
- Arbitrary Writer And Reader Thread
- Arbitrary Buffer Count (DoubleBuffering, TripleBuffering,...)
- Safe Stop
- Generic Data
Test: Change buffer count,buffer size,writers count,readers count in main function and start program. for testing situation that reading or writing are slow there is commented code in Writer and Reader functions. for stop press any key and wait for finished hint in console.