Producer-consumer problem. Which one is the most performant?

  • Hi,
    I have a pipeline where the image generator generates image frames (producer) and the other process processes those generated image frames (consumer). These two processes are completely separate from each other. The speed of each process varies depending on the incoming or being generated image. I am planning to follow the example given in this link.
    However, I am thinking of implementing it using QQueue with a fixed number of image buffers. There is also other way to implement it using regular QVector or QCircularBuffer. I was wondering which one of those would be the most performant? The only think that I would like to achieve is that, there will be limited number of buffers (let say 5), and producer will produce until the buffer is full, then wait, if it sees that the buffer is available, it will continue generating. The consumer will consume the buffers one by one if there is any available.

    I'd appreciate if you could give me some sources to follow if there is any.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.