Professional Documents
Culture Documents
How can CPU information and RAM information be printed on screen in Linux? Write
appropriate commands and paste outcome screens here
Q2 THREADS (20)
Create a shared variable that keeps your roll number as an integer/long. Create three threads.
First thread will generate square of the shared variable and stores it back in the shared variable.
the second thread will generate the cube of latest value and stores it back in the shared variable.
The third thread will generate positive square root of the latest value. All values are shown on
screen in their correct order. The outcome should be properly formatted, and threads must be
scheduled.
You must copy paste code (formatted and commented) and outcome screens. Choice of
language and platform is totally left to you.
Create the Process Tree using fork command in C Language over Linux as shown in Figure 1.
All processes print their own PID. You must copy paste code (formatted and commented) and
outcome screens.
Parent
Child 1 Child 2
Child Child
21 22
Child
221
THE END