Once you fork, each process has its own copy of variables. The easy way to remember that is that a fork creates a new copy of the running parent. In most process models (most notably UNIX) no process can access another's data without explicitly setting up a mechanism to do that. The two common choices are to use threads instead of forking; or to set up some sort of interprocess communication (IPC) between the two processes.
In reply to Re: Child reading from Parent
by steves
in thread Child reading from Parent
by icius
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |