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?
QtWS25 Last Chance

When to use Multithreading?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 940 Views
  • 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.
  • Flaming MoeF Offline
    Flaming MoeF Offline
    Flaming Moe
    wrote on 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
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on 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
      • Flaming MoeF Offline
        Flaming MoeF Offline
        Flaming Moe
        wrote on 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
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on 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

          • Login

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