Find the answer to your Linux question:
Results 1 to 2 of 2
Hello: I have two C++ linux applications on the same processor. One will be producing asynchronous, and variable amount of real time data (max 1500 Bytes, median 80) that needs ...
  1. #1
    Just Joined!
    Join Date
    Oct 2006
    Posts
    22

    Interprocess Communications, Variable sized Data

    Hello:

    I have two C++ linux applications on the same processor. One will be producing asynchronous, and variable amount of real time data (max 1500 Bytes, median 80) that needs to be sent to the second.

    What is the fastest, and easiest way to do this IPC? (e.g., Pipe, FIFO, device driver, etc)? Is seperate messaging or signalling required? Do I need to worry about corruption of the data?

    How would the receiving process handle the unknown size of the arriving data? Would the data need to be contained in some message format,etc?

    Thanks
    --b

  2. #2
    Linux User
    Join Date
    Oct 2004
    Location
    /dev/random
    Posts
    404
    Pipes make sense for a set of processes having a relationship (falling within the same hierarchy - parent-child sort of), so pipes cannot be used for totally independent processes.

    You could use FIFO or even UNIX domain sockets (with select/poll for notifications). Device driver would be an overkill.
    Using UNIX domain sockets would be easier if you've programmed using BSD sockets earlier - you know, the regular internet server/client stuff .

    As for handling of unknown sized data, it depends completely on the requirements of how the receiving process is supposed to handle the data - but the general mechanism is to use the TLV structure - having 3 members Type, Length, Value:
    Type-length-value - Wikipedia, the free encyclopedia

    HTH
    The Unforgiven
    Registered Linux User #358564

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...