I have to read data from a board which generates data at a very high speed. I have to read this data fast, parse it and write to another file. Since read operation is taken at a very high speed, I have to implement two threads in C++. So that one thread reads and the other one writes data to file. Since read and write buffer are same, locking mechanisms could not be used. Implementing using Ring buffer is not a good solution. Any other idea to implement it in C++ which doesn’t reduce read speed?