0% found this document useful (0 votes)
3 views5 pages

Answer LABOS

The document outlines two questions related to process and thread management in a programming context. It details the creation of processes and threads, their names, PIDs, and PPIDs, as well as the implementation of a Round Robin scheduling algorithm. Additionally, it discusses the sharing of data areas between threads and their parent process.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views5 pages

Answer LABOS

The document outlines two questions related to process and thread management in a programming context. It details the creation of processes and threads, their names, PIDs, and PPIDs, as well as the implementation of a Round Robin scheduling algorithm. Additionally, it discusses the sharing of data areas between threads and their parent process.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Answer the following questions:

Question 1

a) Compile the above source code and load it in the main memory. Provide the snapshot of
the compiled code and code loaded in the main memory

b) Create a single process, choose RR scheduling algorithm with time quantum of 5 seconds
with no-priority. Run the Process. Provide the evidence in the form of snapshot of such a
setting.
c) What is the value of “Total” ? Share the snapshot.

d) How many processes and threads are created?

1 Process, 3 threads created

e) Identify the name of the processes and threads.

Process Thread1 Thread2 Thread3

Name PB1_2022wb86633 P1T0 P1TOT1 P1TOT2

PName P1 P1T0 P1TOT1 P1TOT2

f) What is the PID and PPID of the processes and threads created?

Process Thread1 Thread2 Thread3

0 1 2 3
PID
0 3 1 2
PPID
g) Represent the parent and child relationship using tree representation

Question 2

a) Compile the above source code and load it in the main memory. Provide the snapshot of
the compiled code and code loaded in the main memory.
b) Create a single process, choose RR scheduling algorithm with time quantum of 5 seconds
with no-priority. Run the Process. Provide the evidence in the form of snapshot of such a
setting.
c) How many processes and threads are created?

1 Process, 2 Threads

d) Identify the name of the processes and threads.

Process Thread1 Thread2

PB2_2022wb86633 P1T0 P1T0T1


Name
P1 P1T0 P1T0T1
PPID

e) What is the PID and PPID of the processes and threads created?

Process Thread1 Thread2

1 2 3
PID
0 1 2
PPID

f) Represent the parent and child relationship using tree representation.

g) Justify that threads share their parent’s data area.

Thread 1 stores the value “20022wb86633” into s1 of parent’s data area.


Thread 2 stores the value “Samuel” into s2 of parent’s data area.

On Printing the data values of parent s1, s2 It Shows the value. Hence, we can say threads
uses the parent’s data area.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy