Question 3 (25 Marks) a) The address space of typical UNIX processes is composed of different segments, including Text,

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Question 3 (25 Marks) a) The address space of typical UNIX processes is composed of different segments, including Text,

Post by answerhappygod »

Question 3 25 Marks A The Address Space Of Typical Unix Processes Is Composed Of Different Segments Including Text 1
Question 3 25 Marks A The Address Space Of Typical Unix Processes Is Composed Of Different Segments Including Text 1 (52.08 KiB) Viewed 45 times
Question 3 (25 Marks) a) The address space of typical UNIX processes is composed of different segments, including Text, Data, Heap and Stack. Draw a diagram to show how they are stored in the main memory. (4 Marks) Also, indicate which segment(s) will be expanded with directions at runtime. (2 Marks) b) Given a Program Segment, draw a diagram to show how the variables are stored in the main memory. (10 Marks) static int i = 4; int main(...) { int a[16]; int *ptr; int size = 200; ptr = (int *)malloc(size*4);

c) Write down the output of the following program segment. (9 Marks) int main(int argc, char *argv[]) { pid_t pidi, pid2, pid3; == pidi fork(); if (pidi 0) { pid2 - fork(); if (pid2 == 0) { pid3 fork(); == if (pid3 ) { printf("Process 1\n"); } else { wait(NULL); printf("Process 2\n"); printf("Process 2 Done!\n"); } } else { wait(NULL); printf("Process 3\n"); printf("Process 3 Done!\n"); } } wait(NULL); printf("Bye!\n"); return; } // main
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply