Results 1 to 3 of 3

Thread: QsharedMemory or QsharedData ?

Hybrid View

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

    Default Re: QsharedMemory or QsharedData ?

    QSharedData is for sharing data between objects that are implicitly shared (copy-on-write) within a process. Sharing across processes is a QSharedMemory task. You can create() a chunk of memory to contain your shared data structure. Both processes can retrieve/store information in with appropriate use of lock(), unlock(), data(), and constData(). Passing a pointer between processes strikes me as a no-no though: the memory pointed to is part of the sending process and should not generally be accessible from another process.

  2. #2
    Join Date
    Sep 2009
    Location
    phoenix, AZ
    Posts
    41
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QsharedMemory or QsharedData ?

    Hi Chris,

    thanks for your quick answer ...so l should go with Qsharedmemory....but the structrure l want to share has pointers like " QList<a*> *b" initialized in my main .exe. Is there a way l can share this pointers/ data with my other .exe ?

    regards,

    Michael

Similar Threads

  1. QSharedMemory and C++ objects
    By MattPhillips in forum Qt Programming
    Replies: 7
    Last Post: 29th November 2010, 07:42
  2. about the QSharedMemory
    By banban0802 in forum Qt Programming
    Replies: 5
    Last Post: 10th August 2010, 12:08
  3. new vs QSharedMemory
    By JovianGhost in forum Qt Programming
    Replies: 2
    Last Post: 17th March 2010, 00:34
  4. QSharedMemory won't attach
    By MattPhillips in forum Qt Programming
    Replies: 3
    Last Post: 27th November 2009, 15:45
  5. QSharedData - implicit sharing
    By gyre in forum Newbie
    Replies: 4
    Last Post: 28th October 2007, 19:09

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.