Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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).
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Sham Navathe,Ramez Elmasri

5th Edition

B01FGJTE0Q, 978-0805317558

More Books

Students also viewed these Databases questions

Question

# 1 Name Use a loop to write your name ten times

Answered: 1 week ago

Question

Tell the merits and demerits of Mendeleev's periodic table.

Answered: 1 week ago

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago