Results 1 to 2 of 2

Thread: Threads...

  1. #1
    Join Date
    Jun 2008
    Posts
    22

    Default Threads...

    How can I share resources between two threads in Linux??

    I want two processes to be carried out simultaneously on two different threads but I need them to share the same window, the same status bar etc. How can I achieve this?

  2. #2
    Join Date
    Dec 2007
    Posts
    14
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Threads...

    two processes or two threads ??? It isn't clear what you want to do...

    To share items between threads, you've several ways. you can make your variables global or you can pass a pointer to a custom data struct when firying a new thread. In both cases, you have to protect the accesses to the data using locking functions like mutex,conditional variables and so on...not an easy discussion for a single thread...

Similar Threads

  1. Replies: 8
    Last Post: 27th March 2013, 11:51
  2. Calling same method from separate threads
    By steg90 in forum Qt Programming
    Replies: 2
    Last Post: 19th July 2007, 08:55
  3. Once more: Threads in Qt4
    By high_flyer in forum Qt Programming
    Replies: 5
    Last Post: 9th August 2006, 18:35
  4. [QT4] threads, signals, and slots, please help.
    By ucntcme in forum Qt Programming
    Replies: 12
    Last Post: 25th January 2006, 14:23

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.