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. QThread::requestInterruption() cannot be undone
Forum Updated to NodeBB v4.3 + New Features

QThread::requestInterruption() cannot be undone

Scheduled Pinned Locked Moved General and Desktop
22 Posts 4 Posters 13.1k 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.
  • JKSHJ Offline
    JKSHJ Offline
    JKSH
    Moderators
    wrote on last edited by
    #21

    There are different possible solutions; both shared buffers and signals are valid solutions. I don't know the details of your app though, so I can't tell you which approach is better.

    One alternative is to let your SQL thread "pull" data, instead of letting your read thread "push" data -- emit a signal when it wants the read thread to read another line.

    By the way, you might consider combining your read thread and parse thread into one, to simplify your code. Is there any benefit in keeping them separate?

    These examples might be useful too:

    • http://qt-project.org/doc/qt-5/qtcore-waitconditions-example.html
    • http://qt-project.org/doc/qt-5/qtcore-semaphores-example.html

    Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

    1 Reply Last reply
    0
    • VinorcolaV Offline
      VinorcolaV Offline
      Vinorcola
      wrote on last edited by
      #22

      Well, thank you JKSH for your help!

      Yes I think I can combine file reading and parsing in the same thread. Initially, I wanted the parsing thread to bind the parsed string directly into the prepared statement so that the database thread only have to execute the query. But it was impossible, or very very complicated.

      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