Find the answer to your Linux question:
Results 1 to 5 of 5
What would be the best way of process communication in one to many model. i.e one process is talking to many process. This one process should know from which process ...
  1. #1
    Just Joined!
    Join Date
    Jul 2008
    Posts
    22

    Process communication

    What would be the best way of process communication in one to many model. i.e one process is talking to many process.

    This one process should know from which process the reply has come.
    Communication would be two way. A-->pn and pn-->A

    |-------p1
    |-------p2
    |-------p3
    |-------p4
    process A----.
    .
    .
    |-------pn-3
    |-------pn-2
    |-------pn-1
    |-------pn

  2. #2
    Just Joined!
    Join Date
    Dec 2007
    Location
    bangalore
    Posts
    38

    Smile

    using sockets will be the best solution for this.......

  3. #3
    Just Joined!
    Join Date
    Jul 2008
    Posts
    22
    How can i create local sockets . I can't find good reference on this.
    Somebody having an idea??

  4. #4
    Just Joined!
    Join Date
    Dec 2007
    Location
    bangalore
    Posts
    38
    go through the man pages....but since u r a beginner do use steven richards book on socket programming which will help u immenselyy and also mastering socket programming.......or the next easiest way is google for some socket programming tutorials which will be definitely available......

  5. #5
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    I believe that robinsonvpanicker is referring to the book published by Addison Wesley entitled UNIX Network Programming, volume one, by W. Richard Stevens of happy memory, Bill Fenner, and Andrew M. Rudoff. If you're going to do serious network programming, this book is indispensable.

    If process A wishes to broadcast to every process in a particular set, and the total amount of broadcast data is neither infinite nor extremely huge, another alternative is for process A to create a file and repeatedly append to it. In that case, the other processes can check the length of the file repeatedly to see whether that length has changed.

    This alternative is more crude than the network programming approach, but if it works for you it will probably take much less development time, particularly if you're not already familiar with network programming and have no other reason to become familiar with it.

    If you use this alternative, be sure to use advisory record locking to synchronize activity within the file.
    --
    Bill

    Old age and treachery will overcome youth and skill.

Posting Permissions

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