Results 1 to 2 of 2

Thread: Difference between Qt::QueuedConnection vs Qt::BlockingQueuedConnection

  1. #1
    Join Date
    Apr 2007
    Posts
    62
    Thanks
    43
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Difference between Qt::QueuedConnection vs Qt::BlockingQueuedConnection

    What is the difference between Qt::QueuedConnection vs Qt::BlockingQueuedConnection

    So, reading from here (search for ConnectionType)

    Qt.QueuedConnection -> When emitted, the signal is queued until the event loop is able to deliver it to the slot.

    Qt.BlockingQueuedConnection -> Same as QueuedConnection, except that the current thread blocks until the slot has been delivered. This connection type should only be used for receivers in a different thread. Note that misuse of this type can lead to dead locks in your application.

    My question is, if BlockingQueuedConnection is the same as QueuedConnection, why would "the current thread blocks until the slot has been delivered"? Isn't the whole point of having a queued connection to prevent the signaler from blocking?

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Difference between Qt::QueuedConnection vs Qt::BlockingQueuedConnection

    If you are using locally allocated memory (Eg. on the stack), then you don't want to delete that memory until the slot is called and completed, thus you would use a BlockingQueuedConnection.

Similar Threads

  1. Replies: 1
    Last Post: 7th October 2008, 13:11
  2. Difference between libQtCore.so libQtCore.so.4
    By William Wilson in forum Qt Programming
    Replies: 1
    Last Post: 20th November 2007, 08:05
  3. Qt::QueuedConnection and passing by Reference
    By soul_rebel in forum Qt Programming
    Replies: 5
    Last Post: 11th November 2007, 19:47
  4. Difference between QHttp::get and QHttp.request
    By LMZ in forum Qt Programming
    Replies: 2
    Last Post: 6th September 2007, 17:15
  5. Difference between Qtopia Core/Platform/Phone/PDA
    By nupul in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 13th March 2007, 08:48

Tags for this Thread

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.