* Compiler
* Linker
* Loader
* Boot
module or boot ROM
char a[100];
main(int
argc, char **
argv)
{
int
d;
staticdouble
b;
char *s
= "boo", * p;
p = malloc(300);
return
0;
}
Identify the segment in which each variable resides
and indicate if the variable is private to the thread or is shared among
threads.
Be careful.
1. What is the effect of
having such a large number of registers on the operating system?
2. What additional hardware
features you would recommend added to the design above.
3. What happens if the hardware
designer also wants to add a 16-station pipeline into the CPU. How would
that affect the context
switching overhead?
if(child == 0)
{
Program 1:
main()
{
val = 5;
if(fork())
wait(&val);
val++;
printf("%d\n", val);
return val;
}
Program 2:
main()
{
val = 5;
if(fork())
wait(&val);
else
exit(val);
val++;
printf("%d\n", val);
return val;
}