Results 1 to 6 of 6

Thread: BlockingQueuedConnection is not working it is leading to deadlock condition.

  1. #1
    Join Date
    Dec 2011
    Posts
    7
    Qt products
    Qt/Embedded

    Default BlockingQueuedConnection is not working it is leading to deadlock condition.

    Hi everyone,
    I am uing Qt:: BlockingQueuedConnection in the connect option like below, but it going to deadlock state when i use this please help me in this issue soon am a newbie to Qt.. Here is my code
    Qt Code:
    1. connect (this, SIGNAL(moduleDatarcvd(int)), this, SLOT(ShowModuleSimWnd(int)),Qt::BlockingQueuedConnection);
    To copy to clipboard, switch view to plain text mode 

    here i am waiting for a signal to come when my ShowmoduleSimWnd method is called. please tell me an alternative that wath i can use.and for this blocking of my ui is happening. please help me

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: BlockingQueuedConnection is not working it is leading to deadlock condition.

    Don't ask the same question in two places... it is bad manners and only serves to fracture any response.

  3. #3
    Join Date
    Dec 2011
    Posts
    7
    Qt products
    Qt/Embedded

    Default Re: BlockingQueuedConnection is not working it is leading to deadlock condition.

    Sorry i am new to this forum..

  4. #4
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: BlockingQueuedConnection is not working it is leading to deadlock condition.

    rtfm
    Qt::BlockingQueuedConnection - Same as QueuedConnection, except the current thread blocks until the slot returns. This connection type should only be used where the emitter and receiver are in different threads. Note: Violating this rule can cause your application to deadlock.
    http://doc.qt.nokia.com/4.7-snapshot...ctionType-enum
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  5. #5
    Join Date
    Dec 2011
    Posts
    7
    Qt products
    Qt/Embedded

    Default Re: BlockingQueuedConnection is not working it is leading to deadlock condition.

    Qt Code:
    1. void VSDPM_CDT::DisplaySimWnd(int nModule)
    2. {
    3. emit moduleDatarcvd(nModule);
    4. }
    To copy to clipboard, switch view to plain text mode 

    Here i am emitting a signal i.e n module and at receiver side:
    Qt Code:
    1. connect (this, SIGNAL(moduleDatarcvd(int)), this, SLOT(ShowModuleSimWnd(int)),Qt::BlockingQueuedConnection);
    To copy to clipboard, switch view to plain text mode 

    and my ShowmoduleSimWnd is a method which will be called when it is received a signal i.e

    Qt Code:
    1. void VSDPM_CDT::ShowModuleSimWnd(int nModule)
    2. {
    3. if(nModule == 0)
    4. {
    5. OnClickCanSimulation();
    6. }
    7. else if(nModule == 1)
    8. {
    9. OnClickLinSimulation();
    10. }
    11. else if(nModule == 2)
    12. {
    13. OnClickADCSimulation();
    14. }
    15. else if(nModule == 3)
    16. {
    17. OnClickDIOSimulation();
    18. }
    19. else if(nModule == 4)
    20. {
    21. OnClickPWMSimulation();
    22. }
    23. else if(nModule == 5)
    24. {
    25. ShowLogMessage("test","Inside module");
    26. OnClickTCPIPSimulation();
    27. }
    28. else if(nModule == 6)
    29. {
    30. OnClickBTSimulation();
    31. }
    32. }
    To copy to clipboard, switch view to plain text mode 

    in lin if(nModule == 5) i am getting a problem. Actually i am blocking the queue here to wait for a signal to come. please help me in this scenario

  6. #6
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: BlockingQueuedConnection is not working it is leading to deadlock condition.

    You have not given enough information. May I direct you to my signature.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

Similar Threads

  1. Replies: 3
    Last Post: 2nd January 2012, 11:57
  2. Replies: 7
    Last Post: 27th December 2011, 13:28
  3. QFontMetrics::leading() returns negative value.
    By JantarManter in forum Qt Programming
    Replies: 0
    Last Post: 19th May 2010, 14:45
  4. BlockingQueuedConnection hang
    By ^NyAw^ in forum Qt Programming
    Replies: 7
    Last Post: 17th February 2010, 18:30
  5. Replies: 1
    Last Post: 6th November 2009, 18:33

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.