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. Does calling QObject::connect() spawn a new thread internally? ["SOLVED"]

Does calling QObject::connect() spawn a new thread internally? ["SOLVED"]

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 1.2k 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.
  • J Offline
    J Offline
    jeevan_reddy
    wrote on last edited by
    #1

    Does calling a connect() actually create a new thread? I just wanted to know since one of my colleague says so?
    According to him calling connect() in a loop repeatedly creates multiple threads, which can be observed from windows task manager.

    It is no where mentioned in Qt docs thats calling a coonect() spawns a thread.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      No. It does not.
      You have all the source code available, so you can check if you want. But really: no threads are involved.

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jeevan_reddy
        wrote on last edited by
        #3

        @Andre - Thanks a lot Andre.

        1 Reply Last reply
        0
        • JeroentjehomeJ Offline
          JeroentjehomeJ Offline
          Jeroentjehome
          wrote on last edited by
          #4

          Hm, you would only make the event handler very busy.

          Greetz, Jeroen

          1 Reply Last reply
          0
          • J Offline
            J Offline
            jeevan_reddy
            wrote on last edited by
            #5

            @Jeroentje - thanks for the reply.

            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