Results 1 to 2 of 2

Thread: Communication between QThread and boost threads

  1. #1
    Join Date
    Jun 2012
    Posts
    58
    Thanks
    13
    Qt products
    Qt4

    Default Communication between QThread and boost threads

    The Gui is in Qt and Api is in boost. The Gui is meant to sit on top of Api. One of the functions of Api is to do network level data management, process data in certain ways and communicate with the Gui (ie., bridge Gui with other end of Api). To keep the GUI from freezing Api does it's work in a separate thread. If both Gui and Api had used Qt, communication would have been easier with cross-threaded signal-slot mechanism of Qt. Api emits and returns immediately and vice-versa. So none would be blocked unless explicitly specified (Qt::BlockingQueuedConnection). I've been using boost only since a while back as it was required to code new Api in boost. How do i achieve this mechanism in boost <--> Qt communication? Api is going to be header+static_library and so Gui and Api will produce single executable. I have to support Linux, Windows and Mac minimum.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Communication between QThread and boost threads

    It depends on how your API works, what it is supposed to do and what it is supposed to communicate to the UI. In general data exchange between threads requires synchronization using semaphores or similar mechanisms.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Communication/data sharing between threads
    By Tottish in forum Newbie
    Replies: 6
    Last Post: 8th July 2013, 07:33
  2. Communication between Threads
    By Wan-Hi in forum Newbie
    Replies: 11
    Last Post: 24th January 2013, 13:52
  3. Replies: 4
    Last Post: 7th March 2010, 17:58
  4. QThread communication with GUI
    By ldiamond in forum Qt Programming
    Replies: 1
    Last Post: 14th March 2008, 01:00
  5. Threads communication
    By probine in forum Qt Programming
    Replies: 4
    Last Post: 31st March 2006, 15:46

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.