Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Multi Threading
Forum Update on Monday, May 27th 2025

Multi Threading

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 444 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.
  • ashajgA Offline
    ashajgA Offline
    ashajg
    wrote on last edited by
    #1

    Hi guys

    Just want your suggestions...
    I am trying to fetch data from a serial port (not using QSerialport)
    When I am doing this in single thread some data loss is their because I am reading 23 bytes at once and checking its start byte and stop byte and number of bytes and if condition fails I am discarding the packet … and its a time driven operation I am using timers to call a function which is doing this operation.

    So now what I am going to do is I ll seprate reading logic and packet identification logic in two separate threads. I ll push packets in a buffer(queue ) and I ll read that buffer and put some logic so that I can handle this data packet thing efficiently.

    I am not having much idea about Multithreading so I have tried a small example of multithreading using run() method .

    But I need some suggestions in how many ways I can create threads and what approach I should take.

    Thanks
    Ashish

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      You can use use following mechanism to work with threads.

      1. Create the object
      2. Move the the object to new thread using moveToThread
      3. Use started() signal thread to connect with slot

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

      1 Reply Last reply
      5
      • ashajgA Offline
        ashajgA Offline
        ashajg
        wrote on last edited by
        #3

        @dheerendra ok sir I ll try this.

        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