Producer thread: structAnimXf{TArrayXf;TArrayVelocity;};structMyProducer{MyConsumerConsumer;//Ownsthetriplebuffer.AnimXf*Buffer=nullptr;//Thisfunctioniscalledrepeatedlyatsomeintervalbytheproducingthread.voidProduce(){//Getanewbufferifweneedone.if(!Buffer)Buffer=Consumer.AnimXfTripleBuffer.ExchangeProducerBuffer();//ThisclassnowhasexclusiveownershipofthememorypointedtobyBuffer.Buffer->Xf=...;Buffer->Velocity=...;//Pushthenewvaluestotheconsumer,andgetanewbufferfornexttime.Buffer=Consumer.AnimXfTripleBuffer.ExchangeProducerBuffer();}};