managing father and son processes

This is a discussion on managing father and son processes within the C Programming forums, part of the General Programming Boards category; I would like the son process to communicate with the father because when the son dies, it seem that the ...

  1. #1
    Registered User
    Join Date
    Jun 2005
    Posts
    2

    managing father and son processes

    I would like the son process to communicate with the father because when the son dies, it seem that the variables modified by the son go lost, because the son creates a copy of all the variablesm I'd like isntead some of them to remain there

    if you have examples pleasepast some code

    we are new to c programming

    thanks

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,484
    Yeah, which operating system and compiler are you using?

    Not to be picky, but this is deep stuff for newbies.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Jun 2005
    Posts
    2
    I know it's noobish but....
    linux, gcc

    thanks for your help

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,484
    man 2 pipe

    Probably the easiest way is to create a pipe() before fork() and execl() the child process.
    The child can then write() to one end of the pipe, and the parent can read() from the other end.

    A board search for "pipe" will reveal some stuff
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  5. #5
    #include<xErath.h> xErath's Avatar
    Join Date
    Jun 2004
    Posts
    722
    or you can use threads...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Father and Son Variables
    By khdani in forum Linux Programming
    Replies: 3
    Last Post: 11-28-2008, 05:42 PM
  2. Simple Processes Program
    By khdani in forum Linux Programming
    Replies: 9
    Last Post: 11-18-2008, 09:59 AM
  3. Religion
    By gnu-ehacks in forum A Brief History of Cprogramming.com
    Replies: 239
    Last Post: 01-26-2002, 09:44 AM
  4. BST/Red and Black Tree
    By ghettoman in forum C++ Programming
    Replies: 0
    Last Post: 10-24-2001, 10:45 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21