Le 14/06/2016 19:24, Edward Bartolo a écrit :
> To me fork() looks much more than simply a function that does
> some processing returning a result as it looks more like an
> instruction directed at the kernel scheduler to split the process into
> a parent and child that are not equal in all respects.
They are *equal* in absolutely all respects except a bookkeeping
detail: the kernel decides that one of them is the parent and the other
is the child. And fork() informs them of this status by the means of its
return value. Appart from this detail, every variable has the same value
and the program-counter is the same. The image carried by the word
"fork" is very explicit: the two processes are the same in the past and
different in the future. And you are free to decide which of them will
do what - but, ok, you can wait() a child but not a parent.
Didier