PDA

View Full Version : Appropriate QFuture use?



mgb_qt
22nd July 2010, 17:26
I have a camera grabbing frames at it's own fixed rate.

The camera API uses a C lib and a 'C' callback function when each new frame arrives.
it's a bit tricky to use the 'C' callback with Qt and signals so I thought of putting the camera into it's own thread, blocking on each new image and signalling the Qt app when there is a new frame to display.

Is QFuture appropriate for this?
It's not typical because it has no end, but it does have a continuously updating current 'result'.

wysota
22nd July 2010, 17:54
Is QFuture appropriate for this?
No, it's not.

mgb_qt
22nd July 2010, 18:12
So QFuture/QConcurrent is only for 'map-reduce' type = throw a problem at N processes, wait for the answers?

Back to the traditional threading/mutex/semaphore/debugging then .... ;-(

wysota
22nd July 2010, 19:34
So QFuture/QConcurrent is only for 'map-reduce' type = throw a problem at N processes, wait for the answers?
No, it's not :)