OS - Wipro - Lab Sheet-02
OS - Wipro - Lab Sheet-02
OS - Wipro - Lab Sheet-02
2. Prerequisite:
Refer to the “Multithreading” video capsule available in eLearn Portal’s
Labware page.
3. Important Instructions:
a. Experiments should be conducted on the BITS Nuvepro Cloud Lab only.
Experiments conducted outside this lab platform will not be evaluated.
b. Instructions on how to access and use the Nuvepro Cloud lab platform are
available in the document “Steps to access cloud-based CS/IS virtual lab.pdf”.
c. While using the Nuvepro Cloud, save all your work in the Persistent folder,
which is available on the desktop. (Important Note: Always take backup of this
folder.)
d. The completed worksheet should be uploaded in Taxila (elearn) portal only.
The last date for uploading the document is 24-sept-2024.
e. This worksheet/lab activity carries 2.5% of weightage.
f. Refrain from copying or sharing documents with others. Any evidence of such
practice will attract severe penalties.
g. Any queries related to LAB Activities should be asked only through eLearn
portal under discussion forum. Use the below mentioned link to access the
same:
Section Discussion Forum Link
SEWIZC364 https://taxila-aws.bits-
pilani.ac.in/mod/forum/discuss.php?d=68446#p145218
SSWTZC364 https://taxila-aws.bits-
pilani.ac.in/mod/forum/discuss.php?d=68447#p145219
1
CSIWZC364 https://taxila-aws.bits-
pilani.ac.in/mod/forum/discuss.php?d=68448#p145220
4. Lab Exercise:
Problem Statement 1: Consider the following source code. (Program name (should be
your <PB1_ID Number>. Any other name will fetch “0 marks”)
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.
Note: To avoid white spaces and double quotes in the program, copy the given program
in the note pad and then transfer it in compiler editor.
2
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?
e) Identify the name of the processes and threads.
f) What is the PID and PPID of the processes and threads created?
g) Represent the parent and child relationship using tree representation
Problem Statement 2: Following exercise demonstrates how the threads share the parents
data area. Consider the following program (Program name should be your <PB2_ID
Number>. Any other name will fetch “0 marks”).
var s1 string(12)
var s2 string(20)
sub thread1 as thread
s1 = “TEXT1”
writeln(“In thread1”)
for i = 1 to 5
writeln("In thread1: ", i)
next
end sub
end sub
call thread2
writeln(“In main”)
wait
3
writeln(s1)
writeln(s2)
end
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.
Note: To avoid white spaces and double quotes in the program, copy the given program
in the note pad and then transfer it in compiler editor.
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?
d) Identify the name of the processes and threads.
e) What is the PID and PPID of the processes and threads created?
f) Represent the parent and child relationship using tree representation.
g) Justify that threads share their parent’s data area.