Results 1 to 4 of 4

Thread: Appropriate QFuture use?

  1. #1
    Join Date
    Oct 2008
    Posts
    5
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Appropriate QFuture use?

    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'.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Appropriate QFuture use?

    Quote Originally Posted by mgb_qt View Post
    Is QFuture appropriate for this?
    No, it's not.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Oct 2008
    Posts
    5
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: Appropriate QFuture use?

    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 .... ;-(

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Appropriate QFuture use?

    Quote Originally Posted by mgb_qt View Post
    So QFuture/QConcurrent is only for 'map-reduce' type = throw a problem at N processes, wait for the answers?
    No, it's not
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. QtConcurrent mappedReduced QFuture Core Dump
    By shawno in forum Qt Programming
    Replies: 0
    Last Post: 16th July 2010, 02:29
  2. Replies: 14
    Last Post: 8th September 2009, 11:01

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.