Results 1 to 3 of 3

Thread: What is the best way to share data between 2 programs?

  1. #1
    Join Date
    Nov 2007
    Location
    Russia, Moscow
    Posts
    21
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default What is the best way to share data between 2 programs?

    Hi all
    I have a closed-source program that is collecting data from a scientific measuring device. let's say it's a device driver.
    I whant to make an open source user interface for this device.
    With this UI i whant to
    1) plot the measuring graphs with QWT
    so i need to send the measuring data arrays to the UI
    2) control the device with some buttons in the UI
    so i need to send some info from UI to the driver

    How do i implement the applications connections? The driver is going to be pure C/C++ application with a closed source and the UI is going to be a QT application. I don't whant to break GPL license, but i can't show the source of the driver.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: What is the best way to share data between 2 programs?

    Are these two applications going to be run on the same machine? Is it going to be Unix only system?

    If yes, you can take a look at named pipes, FIFOs, Unix domain sockets and shared memory. On windows named pipes and shared memory are available too, but I'm not sure about the rest. You can also consider DBUS (there should be windows port, but I'm sure if windows version of Qt supports it).

    Which one to use depends on the protocol you want to use to exchange data. There won't be any problems with GPL, if you are going to have two separate applications that just exchange the data.

    Edit: Personally I would consider Unix domain sockets and DBUS (esp. if you can use Qt for the driver as well).
    Last edited by jacek; 27th May 2008 at 16:35.

  3. #3
    Join Date
    Nov 2007
    Location
    Russia, Moscow
    Posts
    21
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: What is the best way to share data between 2 programs?

    Quote Originally Posted by jacek View Post
    Are these two applications going to be run on the same machine?
    yes. they should run on the same machine.
    Is it going to be Unix only system?
    the first OS will be Linux, but in future the system should work on both windows and unix.

    if you can use Qt for the driver as well
    i would love to, but i can't open the driver under GPL and i can't pay for the commercial QT.

    Thx for the list of possibilities. The problem is that the amount of data is really big. So i see the only way to avoid memory doubling -- Shared Memory.
    The driver will then use the OS API for Shared Memory and the UI will use QT implementatnion of Shared Memory.

Similar Threads

  1. Replies: 4
    Last Post: 19th October 2007, 19:47
  2. Data model
    By steg90 in forum Qt Programming
    Replies: 3
    Last Post: 17th September 2007, 12:14
  3. speed of setdata - lots of items in treeview
    By Big Duck in forum Qt Programming
    Replies: 4
    Last Post: 6th July 2006, 12:53
  4. Replies: 16
    Last Post: 7th March 2006, 15:57
  5. Help me to use QtSharedMemory to share the data objects
    By gtthang in forum Qt Programming
    Replies: 3
    Last Post: 17th February 2006, 11:50

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.