Results 1 to 7 of 7

Thread: QFutureWatcher and "cancel" on a QtConcurrent filter...

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QFutureWatcher and "cancel" on a QtConcurrent filter...

    If you do not connect any signals from the watcher tthen I don't see how throttling is of any use to you. It makes sense only if the producer is faster than the consumer for really large data sets where resource consumption matters. If you are not processing entries as they appear in the result (which would require the use of signals) then if throttling kicked in your operation would never complete.

    Maybe you should describe what you are trying to achieve with QtConcurrent, why you need throttling and how you process the results.
    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.


  2. #2
    Join Date
    Dec 2013
    Posts
    14
    Thanks
    2
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: QFutureWatcher and "cancel" on a QtConcurrent filter...

    Quote Originally Posted by wysota View Post
    If you do not connect any signals from the watcher tthen I don't see how throttling is of any use to you. It makes sense only if the producer is faster than the consumer for really large data sets where resource consumption matters. If you are not processing entries as they appear in the result (which would require the use of signals) then if throttling kicked in your operation would never complete.

    Maybe you should describe what you are trying to achieve with QtConcurrent, why you need throttling and how you process the results.
    i process [some of the] future results in the main/ui thread, but for particular reasons i'm using own signals instead of the watcher ones.

    i work on a plugin that needs to access two different, both non thread safe api's (one from a Qt based host application, and external other one), so whenever i like to offload processing to keep the ui responsive it gets complicated, not the last because i have only very limited control - for example the threadpool threads limit; in this particular case the thread limit is already way beyond what is healthy for the particular modules task (thumbnails rendering on a gpu), so i need a way to limit concurrent processing on my own.

    the key part in the docs description is the wording "pending signals". i of course see that to calculate a "pending" number (to test against a limit) needs something that adds and removes signals from a "pending" list (however that works). means you are probably right that watcher throttling won't work if i don't use the internal methods to consume results. after some test it seems that the setting has just no effect at all in this case - even if i set the limit to "1" the filter still runs down the sequence without being ever paused... so i'm going to use a semaphore.

    thanks for your help...

Similar Threads

  1. Proper handling "Cancel" click for QWizard
    By Splinter in forum Qt Programming
    Replies: 4
    Last Post: 17th September 2012, 14:34
  2. Replies: 3
    Last Post: 8th December 2011, 19:21
  3. Replies: 3
    Last Post: 15th February 2010, 17:27
  4. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05
  5. Replies: 11
    Last Post: 10th July 2007, 15:58

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
  •  
Qt is a trademark of The Qt Company.