Tutorial
Tutorial
Text 8K b
Process Shared region
A Data 16K
Stack 32K
Virtual
c
addresses a
Text 4K
Process
Data
8K e
B
Stack
32K
Processes A and B
access the same
d
physical location
if (pid == 0) {
fork() Operating System printf(“this is the child process\n”);
exit (0);
}
else if (pid>0) {
printf(“this is the parent process\n”);
Hardware wait (0);
}
else printf(“ERROR\n”);