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. GUI Freeze on Multi-Thread Application
QtWS25 Last Chance

GUI Freeze on Multi-Thread Application

Scheduled Pinned Locked Moved Unsolved General and Desktop
threadingserial portdatabasemulti-threadfreeze
5 Posts 3 Posters 991 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.
  • M Offline
    M Offline
    mvsri
    wrote on 3 Sept 2021, 08:41 last edited by
    #1

    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
    0
    • J Online
      J Online
      JoeCFD
      wrote on 3 Sept 2021, 13:49 last edited by
      #2

      add mutex to places where it is needed.

      M 1 Reply Last reply 3 Sept 2021, 17:00
      0
      • J JoeCFD
        3 Sept 2021, 13:49

        add mutex to places where it is needed.

        M Offline
        M Offline
        mvsri
        wrote on 3 Sept 2021, 17:00 last edited by
        #3

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

        J 1 Reply Last reply 3 Sept 2021, 17:11
        0
        • M mvsri
          3 Sept 2021, 17:00

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

          J Online
          J Online
          JoeCFD
          wrote on 3 Sept 2021, 17:11 last edited by JoeCFD 9 Mar 2021, 17:14
          #4

          @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
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 3 Sept 2021, 18:29 last edited by
            #5

            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
            0

            4/5

            3 Sept 2021, 17:11

            • Login

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