Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Unsolved GUI Freeze on Multi-Thread Application

    General and Desktop
    threading serial port database multi-thread freeze
    3
    5
    367
    Loading More Posts
    • 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.
    • M
      mvsri last edited by

      Hey there,
      I just need some suggestions on multi-threading to avoid GUI Freeze.
      I developed a system which has three threads excluding main GUI thread.

      Thread 1 : Image Grabber - It captures Image and emit the image for displaying .

      Thread 2 : Serial Reader - I used synchronous Qt Serial Code and values are emitted to display on the GUI.

      Thread 3 : Database Storing - Stores the data coming from Serial Reader (I used it in Main GUI Thread, when Serial Values are displayed on GUI in that function I implemented storing the data in database)

      The system is working fine without freezing and is running 12 hours per day, but at certain times the GUI Freezes when I click on a button or on a popup.
      It would be great if someone can provide me with some useful information on why GUI is Freezing when I click on a button, If I don't press anything the system works fine.
      (Note: this doesn't happen daily it happens once or twice a week).

      1 Reply Last reply Reply Quote 0
      • JoeCFD
        JoeCFD last edited by

        add mutex to places where it is needed.

        M 1 Reply Last reply Reply Quote 0
        • M
          mvsri @JoeCFD last edited by

          @JoeCFD thank you for the reply, In fact, I have added mutex in the code but still, the issue persists.

          JoeCFD 1 Reply Last reply Reply Quote 0
          • JoeCFD
            JoeCFD @mvsri last edited by JoeCFD

            @mvsri there is deadlock in your code. You need to find out the reason. Output more log info. Nobody can help you without looking at your code.

            one possible reason could be a func with mutex is called from another func with mutex.

            1 Reply Last reply Reply Quote 0
            • SGaist
              SGaist Lifetime Qt Champion last edited by

              Hi,

              What kind of popup are triggering the freeze ?

              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 Reply Quote 0
              • First post
                Last post