Hi,

I have two threads in my application. One is a Producer and the other one is a Consumer. The proucer does some work and create a own class object that is inserted on a ring buffer. The consumer reads this buffer objects(when there are almost one).
The consumer then emits the consumed object to the main thread to let it display some data of this object, but it is done by value(not by reference or pointer). This is done because if I pass the object by reference or pointer to the main thread, maybe when it goes to read it, the consumer thread is modifying it and then the values are incorrect.

I want to speed up my application and my question is to use a QMutex ring buffer wich will lock the object so I could pass it as reference(without spending the time to copy the object), and when the main thread finish the reading process it will unlock it to let the consumer and producer continue.

Have anyone a good idea how to speed up this process?

Thanks,