[Qt-interest] need some QThread help

Paul Miller paul at fxtech.com
Tue Apr 26 14:43:28 CEST 2011


On 4/26/2011 1:13 AM, Dave Smith wrote:
> On Apr 25, 2011, at 9:31 AM, Paul Miller wrote:
>
>> This is a simplified version of the problem. I need to save a rather
>> large image (using my own code, not QImage), and I'm saving it 256 lines
>> at a time. So I'm pushing 256 lines of data, and I need the thread to
>> "consume" the 256 lines and I want the producer to wait for the consumer
>> to be finished before it goes to get more lines.
>>
>
> If the producer must wait for the consumer to finish consuming before it can go to get more lines, why do you need threads in the first place? Can the producer and consumer just be the same thread?

Yeah, like I said it was a simplified version of the problem. The part I 
left out was a pull-based scaling engine in the writing code that pulls 
scanlines as it needs them. Since I only have 256 of them at a time on 
the other side I needed a way to bridge the two.




More information about the Qt-interest-old mailing list