Results 1 to 12 of 12

Thread: Does Qt support shared memory ?

  1. #1
    Join Date
    May 2007
    Posts
    91
    Thanks
    60
    Qt products
    Qt4
    Platforms
    Windows

    Default Does Qt support shared memory ?

    Does Qt support shared memory ?
    Cause I need to use it.

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Does Qt support shared memory ?

    Bee more explicit!
    What do you need it for?

  3. #3
    Join Date
    May 2007
    Posts
    91
    Thanks
    60
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Does Qt support shared memory ?

    I need to use shared memory, and i am using qt, I can not find any information in the assitant or examples shows how to used it.

    But actually I remember clearly that once I saw something about the QSharedMemory. I tried to find it in the Assitant but failed...

  4. #4
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Does Qt support shared memory ?

    I don't know what you mean.
    For implementing implicitly shared classes you have QSharedData and QSharedPointer.

    But you say "shared" memory. Shared by what? Threads?

    Regards

  5. #5
    Join Date
    May 2007
    Posts
    91
    Thanks
    60
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Does Qt support shared memory ?

    "Shared Memory is an efficeint means of passing data between programs. One program will create a memory portion which other processes (if permitted) can access. "

    maybe this can help you understand me.

    the shared memory segment will be accessed by two applications and thus implement the communication between them.

  6. #6
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Does Qt support shared memory ?

    Oh, you meant shared by processes. I missed that option .
    In that case you must be referring to QSharedMemory available in Qt 4.4 . See this link:http://doc.trolltech.com/main-snapsh...redmemory.html.

    Anyway, until Qt 4.4 you will have to implement this using platform specific IPC mechanisms( named pipes, sockets, etc).

    You can get started with these examples for windows: http://www.codeproject.com/threads/Win32IPC.asp

    Also, for linux: http://tldp.org/LDP/lpg/node7.html.

    You can find more with google. That's just to get you started.

    Regards

  7. #7
    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: Does Qt support shared memory ?

    You can always use shared memory functions available in the API of your platform. Using Qt doesn't restrict you from using other function calls.

  8. The following user says thank you to wysota for this useful post:

    Shawn (8th September 2007)

  9. #8
    Join Date
    May 2007
    Posts
    91
    Thanks
    60
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Does Qt support shared memory ?

    Yes, you are right.

    I've found CreateFileMapping()...

    Thanks for your time ~

  10. #9
    Join Date
    Mar 2009
    Posts
    19
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Does Qt support shared memory ?

    Hi,

    this may sound stupid but is it possible to share the pointer from http://qt.nokia.com/doc/4.6-snapshot...tapointer.html between two different processes.

    Regards,
    Sriky

  11. #10
    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: Does Qt support shared memory ?

    No, it's not possible.
    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.


  12. #11
    Join Date
    Mar 2009
    Posts
    19
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Does Qt support shared memory ?

    Hi guru,

    What is the best and easiest way to do that. Currently we are following an approach where we serialize and deserialize data at three levels. I am trying to avoid it. Is QSharedMemory the best solution in terms of performance. when compared to serializationa and deserialization.

  13. #12
    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: Does Qt support shared memory ?

    It depends what you want to do. QSharedMemory works on byte level, so you will need to serialize and deserialize your data anyway.
    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. Qt configure with msvc.net
    By jivanr in forum Installation and Deployment
    Replies: 1
    Last Post: 11th June 2007, 08:17
  2. qt-3.3.8 fail in scratchbox
    By nass in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2007, 15:21
  3. Compile QT4.2.2 with MySQL on Mac OS
    By asd in forum Installation and Deployment
    Replies: 7
    Last Post: 12th February 2007, 14:50
  4. Support for File Mapped Memory?
    By Jachyra in forum Qt Programming
    Replies: 8
    Last Post: 5th February 2007, 12:44
  5. saving a c string of variable length in a shared memory?
    By nass in forum General Programming
    Replies: 4
    Last Post: 3rd January 2007, 14:40

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.