Results 1 to 5 of 5

Thread: CPP : Transferring structure between 2 applications

  1. #1
    Join Date
    Jan 2010
    Posts
    29

    CPP : Transferring structure between 2 applications

    Hello, I have to transfer a data structure from one application to another on the same computer under windows XP operating system. It seemed interesting to use the CPI process, however I do not know which to choose. I hesitate to spend my particular between data memory shared with filemapping and then use a pipe. I wish we had some information about these processes and possibly some code examples (including pipes ).
    Thank you in advance

  2. #2
    Join Date
    May 2008
    Posts
    2,012

    Re: CPP : Transferring structure between 2 applications

    I tend to say that everything depends on the size of the structure, and how many times per second you have to transfer ... The memory is, in my opinion, easier to implement than the pipe (which behaves much like a file / socket, so with a little management to see if there is data or not).
    For my part, I prefer the shared memory because it is not dependent on size or a particular communication: you can well have an application "master", which creates this memory and launch signals indicating that the data is ready, while behind multiple applications "slaves" can then retrieve the data.

  3. #3
    Join Date
    Apr 2008
    Posts
    2,005

    Re: CPP : Transferring structure between 2 applications

    Hi, How are you. My structure is not huge (20 values float maximum), for cons I want a big speed access in order to have a database updated very often. I started in the CPI process, I have not looked at the wrong shared memory and mutexes and I have some concerns synchronization of access. What do you mean by having a dedicated thread per process to the decision to transfer information? What should they do?

  4. #4
    Join Date
    Oct 2005
    Posts
    2,393

    Re: CPP : Transferring structure between 2 applications

    Overall, I share the information given to the shared memory, but I bring a few remarks:
    1 / Note that the synchronization mechanism to access is not disadvantageous compared to another channel for the exchange. Do something generic which will allow you to quickly change from one mode of exchange to another then to a bench on performance;
    2 / And I come to the second point. You built a system in 2 separate applications on the same post. From experience, the client has often (but not always) in a second time the desire to deport one of the 2 applications on a different post. And then, the shared memory Assess the risk from your system.

  5. #5
    Join Date
    May 2008
    Posts
    2,389

    Re: CPP : Transferring structure between 2 applications

    If you do manage to be seen as a database (shared), I go to a shared memory protected by a semaphore. The senior manager of data (the writer) created the shared memory and semaphore. When he wants to write it, it takes the semaphore and releases it when he finishes writing. Readers want to read when they take the semaphore, shared memory read and release the semaphore.

Similar Threads

  1. Replies: 4
    Last Post: 21-12-2010, 01:16 PM
  2. Directory structure of Java web applications
    By Gokul20 in forum Software Development
    Replies: 7
    Last Post: 01-09-2010, 10:24 PM
  3. C++ table structure
    By RyanInt in forum Software Development
    Replies: 3
    Last Post: 14-11-2009, 07:50 PM
  4. Pointer to structure in C
    By Jamaima in forum Software Development
    Replies: 3
    Last Post: 08-10-2009, 03:30 PM
  5. Domain Structure
    By solvent in forum Operating Systems
    Replies: 3
    Last Post: 06-03-2009, 10:00 PM

Tags for this Thread

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
  •  
Page generated in 1,713,563,334.14086 seconds with 17 queries