Results 1 to 13 of 13

Thread: cancel slot not getting called with QtConcurrent::run()

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2015
    Location
    India
    Posts
    185
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: cancel slot not getting called with QtConcurrent::run()

    If suppose I need to read 5 lak rows of data from DB, I am starting 5 threads so that each thread read 1 lak rows, at the end I will merge the result.
    The thing is that reading records is from third party function so I do not have control over it(I don't know what is happening inside, how much time will take, I cant not put any bool variable inside it to stop at particular condition ...).
    Thanks :-)

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: cancel slot not getting called with QtConcurrent::run()

    So the third party API only allows you to read 1 lak rows, no smaller amount?

    I.e. you can't read 50 times 0.1 lak rows?

    Cheers,
    _

  3. #3
    Join Date
    Jun 2015
    Location
    India
    Posts
    185
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: cancel slot not getting called with QtConcurrent::run()

    Quote Originally Posted by anda_skoa View Post
    So the third party API only allows you to read 1 lak rows, no smaller amount?
    I can read any number, just I need to pass boundaries (start row & end row Indexes).

    I.e. you can't read 50 times 0.1 lak rows?
    I can, But what is the use of this approach reading 50 times 0.1 lak rows? (Sorry I may not get your logic)

    Note: We did some experiment and find out that more that 8 threads are slowing down the performance on my machines.
    So we are running max 8 threads to to read entire data.
    Thanks :-)

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: cancel slot not getting called with QtConcurrent::run()

    Quote Originally Posted by prasad_N View Post
    I can read any number, just I need to pass boundaries (start row & end row Indexes).
    Then you can split the work into smaller steps, which you said you could not (comment #7)

    Quote Originally Posted by prasad_N View Post
    I can, But what is the use of this approach reading 50 times 0.1 lak rows? (Sorry I may not get your logic)
    Smaller units of work take less time, waiting for such a smaller amount of time on cancel makes the program react to cancel faster.

    Quote Originally Posted by prasad_N View Post
    Note: We did some experiment and find out that more that 8 threads are slowing down the performance on my machines.
    So we are running max 8 threads to to read entire data.
    I already thought that 5 threads are pretty optimistic, but I am not suggesting increasing the number of threads at all.

    Cheers,
    _

  5. #5
    Join Date
    Jun 2015
    Location
    India
    Posts
    185
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: cancel slot not getting called with QtConcurrent::run()

    Quote Originally Posted by anda_skoa View Post
    Then you can split the work into smaller steps, which you said you could not (comment #7)_
    yes, it could have been I don't want instead I cann't :-)


    Quote Originally Posted by anda_skoa View Post
    Smaller units of work take less time, waiting for such a smaller amount of time on cancel makes the program react to cancel faster._
    I will try this and get back with the result, I need to check how much time it will take to read entire DB (My main aim is to minimize reading time).

    Quote Originally Posted by anda_skoa View Post
    I already thought that 5 threads are pretty optimistic, but I am not suggesting increasing the number of threads at all._
    I am working on SLES11 server(high end machine), more that 5 threads might works in my case.
    Thanks :-)

Similar Threads

  1. Slot never called
    By Kola73 in forum Newbie
    Replies: 2
    Last Post: 27th June 2015, 08:48
  2. Replies: 6
    Last Post: 12th February 2015, 12:20
  3. Replies: 2
    Last Post: 26th August 2011, 08:51
  4. Slot gets called twice
    By greatgatsby in forum Newbie
    Replies: 7
    Last Post: 20th August 2009, 15:11
  5. SLOT not being called
    By steg90 in forum Qt Programming
    Replies: 4
    Last Post: 6th December 2007, 11:30

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