Question: Part II ( 5 0 % ) Using the installed Linux operating system, write a C program that defines a global variable with an initial

Part II (50%)
Using the installed Linux operating system, write a C program that defines a global variable with
an initial value (e.g.,100). Your program should create three processes: one parent process and
two child processes.
The parent process will print the value of the global variable.
The first child process will increment the global variable and print its new value.
The second child process will decrement the global variable and print its new value.
Tasks:
Write a C program as described above.
Discuss the order of the output from the parent and children processes.
Explain why the value of the global variable isn't affected by the increment/decrement
operations in other processes.
Use "Itrace" and "strace" with proper parameters to show the list of system calls and
library calls used by your program.
Discuss in detail the system calls used by your program.
Use top or htop to monitor and show real-time process information like CPU and memory
usage, and state during program execution. Discuss observations related to your program's
processes.
Use ps with appropriate options to show detailed information about processes running at the
time of execution. Analyze the output and discuss specific fields relevant to your program
(e.g., Process ID, Parent Process ID, State).
 Part II (50%) Using the installed Linux operating system, write a

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!