Results 1 to 3 of 3

Thread: Signal-Signal Connections Between Threads

  1. #1
    Join Date
    Aug 2008
    Posts
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Signal-Signal Connections Between Threads

    Hi,

    I'm wondering how signal-to-signal connections are handled internally, when every involved object's message loop is run by its own thread.

    I have three objects, connected like this:
    Object A signal() --> Object B signal() --> Object C slot()

    Object B is bound to the GUI thread, while Object A and Object C have both private threads.

    Is Object B's message loop needed for signal forwarding? I would prefer Qt's signal/slot implementation to handle this internally by connecting Object A directly to Object C...

    thanks,
    Philipp

  2. #2
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Signal-Signal Connections Between Threads

    there's always the (open) source so you may check that

  3. #3
    Join Date
    Oct 2008
    Location
    Brazil, Sao Paulo - SP
    Posts
    17
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Signal-Signal Connections Between Threads

    By default, the Object B slot processing that fires the signal to the Object C, will be delivered during the GUI thread. But you can specify a flag on your QObject::connect call to do the handling immediatly, indenpendanf of the involved objects owner threads. Take a look at http://doc.trolltech.com/4.4/threads...across-threads for further explanations.

    Best Regards

Similar Threads

  1. Qt Mem Leak/growth with queued connections across threads?
    By chuckshaw in forum Qt Programming
    Replies: 8
    Last Post: 16th August 2008, 16:43
  2. signal and slot across threads having event loop
    By travis in forum Qt Programming
    Replies: 6
    Last Post: 5th November 2007, 23:56

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.