Page 2 of 2 FirstFirst 12
Results 21 to 31 of 31

Thread: multi threading or QConcurrent for the scenario

  1. #21
    Join Date
    Feb 2015
    Posts
    185
    Thanks
    5
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: multi threading or QConcurrent for the scenario

    QtConcurrent
    QtConcurrentMap

    Both I have included.
    Last edited by ejoshva; 11th March 2015 at 10:42.

  2. #22
    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: multi threading or QConcurrent for the scenario

    Is what you posted a complete error message?
    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. #23
    Join Date
    Feb 2015
    Posts
    185
    Thanks
    5
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: multi threading or QConcurrent for the scenario

    error: no matching function for call to 'mappedReduced'
    QFuture<QString> decryptedContent = QtConcurrent::mappedReduced(fileList,DecryptMap('A '),ReduceS());

  4. #24
    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: multi threading or QConcurrent for the scenario

    And there is nothing more? Nothing about candidates for the proper call or something like that?
    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.


  5. #25
    Join Date
    Feb 2015
    Posts
    185
    Thanks
    5
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: multi threading or QConcurrent for the scenario

    The below warning are also found.

    candidate template ignored: couldn't infer template argument 'ResultType'
    QFuture<ResultType> mappedReduced(const Sequence &sequence,
    ^
    candidate template ignored: deduced conflicting types for parameter 'Iterator' ('QList<QString>' vs. 'DecryptMap')
    QFuture<ResultType> mappedReduced(Iterator begin,
    ^
    candidate template ignored: deduced conflicting types for parameter 'Iterator' ('QList<QString>' vs. 'DecryptMap')
    QFuture<typename QtPrivate::ReduceResultType<ReduceFunctor>::Result Type> mappedReduced(Iterator begin,
    ^
    candidate template ignored: substitution failure [with Sequence = QList<QString>, MapFunctor = DecryptMap, ReduceFunctor = ReduceS]: implicit instantiation of undefined template 'QtPrivate::ReduceResultType<ReduceS>'
    QFuture<typename QtPrivate::ReduceResultType<ReduceFunctor>::Result Type> mappedReduced(const Sequence &sequence,
    ~~~~~~~~~~~~~~~~ ^

  6. #26
    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: multi threading or QConcurrent for the scenario

    So what are the exact signatures of fileList, DecryptA and ReduceS?
    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.


  7. #27
    Join Date
    Feb 2015
    Posts
    185
    Thanks
    5
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: multi threading or QConcurrent for the scenario

    Qt Code:
    1. QList<QString> fileList;
    2.  
    3. struct DecryptMap {
    4. DecryptMap(const QChar &key) : m_key(key) {}
    5. typedef QString result_type;
    6. QString operator()(const QString &item)
    7. {
    8. Decrypt *decrypt = new Decrypt();
    9. qDebug()<<item;
    10. return decrypt->decryptFile(item,'A');
    11. }
    12. QChar m_key;
    13. };
    14. struct ReduceS
    15. {
    16. typedef QString result_type;
    17. void operator()(QString & res, const QString & partial )
    18. {
    19. res.append(partial);
    20. }
    21. };
    To copy to clipboard, switch view to plain text mode 

  8. #28
    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: multi threading or QConcurrent for the scenario

    And what is the exact call to mappedReduced?
    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.


  9. #29
    Join Date
    Feb 2015
    Posts
    185
    Thanks
    5
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: multi threading or QConcurrent for the scenario

    Qt Code:
    1. QFuture<QString> decryptedContent = QtConcurrent::mappedReduced(fileList,DecryptMap('A'),ReduceS());
    To copy to clipboard, switch view to plain text mode 
    Last edited by ejoshva; 14th March 2015 at 11:14.

  10. #30
    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: multi threading or QConcurrent for the scenario

    Try:

    Qt Code:
    1. QFuture<QString> decryptedContent = QtConcurrent::mappedReduced<QString>(fileList,DecryptMap('A'),ReduceS());
    To copy to clipboard, switch view to plain text mode 
    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.


  11. The following user says thank you to wysota for this useful post:

    ejoshva (14th March 2015)

  12. #31
    Join Date
    Feb 2015
    Posts
    185
    Thanks
    5
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: multi threading or QConcurrent for the scenario

    It worked.

Similar Threads

  1. Multi-threading
    By plopes21 in forum Qt Programming
    Replies: 6
    Last Post: 2nd January 2013, 18:45
  2. Slow Multi-Threading
    By AwDogsgo2Heaven in forum Qt Programming
    Replies: 5
    Last Post: 19th July 2009, 22:36
  3. Multi-threading
    By lixo1 in forum Qt Programming
    Replies: 5
    Last Post: 22nd June 2009, 14:22
  4. Multi threading ...
    By kiranraj in forum Qt Programming
    Replies: 2
    Last Post: 18th June 2007, 17:51
  5. Multi-threading
    By shamik in forum Qt Programming
    Replies: 15
    Last Post: 28th November 2006, 11:22

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.