It is currently Sat, 26 Nov 2022 05:31:10 GMT



 
Author Message
 Parent and Child process accessing global variable?
Hi All,

I've a little problem which I'm unsure about.

I've a global variable which needs to be undated by a child process which I
create using fork(). It appears that the changes which the child process
makes are only visible in this process and not in the parent one. When the
child process terminates, the changes which it appears to have made are
lost.

Is there anyway to make the changes to the global variable permanent?

The variable is a linked listed of a struct which I have defined .. if that
makes any difference ...

Thanks to all,

Best wishes.

Chris.



 Fri, 06 Apr 2001 03:00:00 GMT   
 Parent and Child process accessing global variable?

Data is not shared between child and parent. Your program will have to take
to exchange the data created:
     - store this data in shared memory
     - write the data to a file
     - send the data from the child to the parent via a pipe

Paul



 Fri, 06 Apr 2001 03:00:00 GMT   
 
   [ 2 post ] 

Similar Threads

1. fork, parent, child and global variables

2. Child Process Waiting for Parent Process

3. child processes not dying with parent process??

4. Parent process also terminating after killing child process in SIGINT

5. Parent process also terminating after killing child process in SIGINT

6. detatch a child process from its parent process

7. child process of parent process group

8. Looking for a command to show all CHILD processes of a specific parent process

9. Child process terminates when parent process killed


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software