Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. When to use Multithreading?
Forum Updated to NodeBB v4.3 + New Features

When to use Multithreading?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 958 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Flaming Moe
    wrote on 21 Sept 2014, 07:38 last edited by
    #1

    Hello,

    i´m asking for a feedback, if i have reached a point where i need multithreading.
    I have made an exercise where i´m using QPainter to paint a coordinate system and a graph.
    There is a timer´s timeout running and on each timeout the next graph´s point is plotted with the value
    of a slider at that time out. So the graph grows from left to right with time dependent x-axis
    and a slider dependent y-axis. The timer is started the first time when i change the slider.

    Point of interest:
    when i make a layout = new QVBoxLayout in main() and add two of the "MyGrapWidgets" only the one i use first is active and gets plotted. Is this the point to use multithreading?

    your´s sincerly,
    Moe

    A lovely day for a ̶g̶̶u̶̶i̶̶n̶̶n̶̶e̶̶s̶ DUFF^^

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dheerendra
      Qt Champions 2022
      wrote on 21 Sept 2014, 12:04 last edited by
      #2

      Definitely this does not calls for creating the threads. General inputs is that if you are doing some background task which consumes time, you are better of creating the threads do the work.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      0
      • F Offline
        F Offline
        Flaming Moe
        wrote on 21 Sept 2014, 14:43 last edited by
        #3

        I don´t really understand the answer, may be it´s because i´m not native english speaker. Could you formulate it differently?

        A lovely day for a ̶g̶̶u̶̶i̶̶n̶̶n̶̶e̶̶s̶ DUFF^^

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 21 Sept 2014, 19:42 last edited by
          #4

          Hi,

          Dheerendra meant that it's not the case. You should start thinking about using thread if you have some heavy computation going on your data before painting.

          You more likely have a bug in your code.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          1/4

          21 Sept 2014, 07:38

          • Login

          • Login or register to search.
          1 out of 4
          • First post
            1/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved