ring.hpp (316B)
1 #ifndef RING_HPP 2 #define RING_HPP 3 4 #include <atomic> 5 #include <cstddef> 6 #include <cstdint> 7 8 #include "benchmark.h" 9 10 namespace lf { 11 12 template <typename T> 13 struct ring { 14 private: 15 T *buffer; 16 size_t cap, cur; 17 }; 18 19 struct benchmark 20 ring_benchmark(void) 21 { 22 return {"Lock-free Ring Buffer"}; 23 } 24 25 }; 26 27 #endif /* RING_HPP */