Qt Forum

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

    Unsolved what is thread affinity

    General and Desktop
    3
    5
    665
    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.
    • J
      JadeN001 last edited by

      I have read all about threadAffinity in Qtfrom all over google but i really do not understand what actually it is.what is meanning of "threadAffinity".please tell me based on your understanding.

      JonB 1 Reply Last reply Reply Quote 0
      • JonB
        JonB @JadeN001 last edited by JonB

        @JadeN001
        https://forum.qt.io/topic/58928/what-is-the-meaning-of-thread-affinity
        https://stackoverflow.com/questions/23931492/confusion-regarding-qthread-qobject-thread-affinity-and-event-loop
        https://en.wikipedia.org/wiki/Processor_affinity
        ?

        J 1 Reply Last reply Reply Quote 2
        • J
          JadeN001 @JonB last edited by

          @JonB i already read all these link.but i don't understand its proper meaning.

          JonB 1 Reply Last reply Reply Quote 0
          • JonB
            JonB @JadeN001 last edited by

            @JadeN001
            I thoguht https://forum.qt.io/topic/58928/what-is-the-meaning-of-thread-affinity/2 from @JKSH made it clear:

            If the receiver QObject has an affinity for Thread B, then the slot function runs in Thread B.
            You can change the QObject's thread affinity by calling QObject::moveToThread().

            It's a way of choosing which thread a QObject's slot functions run in.

            1 Reply Last reply Reply Quote 5
            • mrjj
              mrjj Lifetime Qt Champion last edited by

              Hi
              If you think of affinity as "belongs to/run on/in that context" it might make more sense.

              1 Reply Last reply Reply Quote 2
              • First post
                Last post