Results 1 to 7 of 7

Thread: Communication/data sharing between threads

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2010
    Posts
    77
    Thanks
    17
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Communication/data sharing between threads

    Hi!

    EDIT: SKIP THIS PART I screwed up and it is not an issue anymore.
    I'm experiencing some serious difficulties that I perceive as very strange indeed!
    I'm programming a multi Thread app and all of a sudden the compiler starts to complain about "xxx" does not name a type when I declare "xxx" under private in my .h file. I can't figure out what the heck the difference is from half an hour ago.

    HERE IS THE PROBLEM:
    I have two threads (+ a GUI-thread) thread one and thread two.
    I can write and read back OK from thread one to Thread twos public variables. But when I try to read them in thread two I get nonesense result: 7.11756e-307.
    How could this be?

    EDIT2:
    When I write to thread twos public vars from the GUI-thread it sticks and is the same when read back from within thread two... Does thread one lack some kind of writing-rights? I think it's strange that it can write and read back the same result, though.
    Perhaps it is easier to only use the GUI-thread's public vars for inter threaded communication but I cant seem to get that going either...

    Cheers!
    /Tottish
    Last edited by Tottish; 14th April 2010 at 15:43.

Similar Threads

  1. Communication between Threads
    By Wan-Hi in forum Newbie
    Replies: 11
    Last Post: 24th January 2013, 12:52
  2. Sharing between two Threads
    By donglebob in forum General Programming
    Replies: 2
    Last Post: 30th October 2008, 08:58
  3. Sharing data between threads
    By bbui210 in forum Qt Programming
    Replies: 15
    Last Post: 19th October 2008, 17:56
  4. Sharing data across threads
    By jphn_crichton in forum Qt Programming
    Replies: 11
    Last Post: 5th May 2008, 18:29
  5. Threads communication
    By probine in forum Qt Programming
    Replies: 4
    Last Post: 31st March 2006, 14:46

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
  •  
Qt is a trademark of The Qt Company.