Question: Consider the following source code program ThreadTest total = 1 0 sub thread 1 as thread for i = 1 to 2 total = total

Consider the following source code
program ThreadTest
total =10
sub thread1 as thread
for i =1 to 2
total = total - i
next
end sub
sub thread2 as thread
for i =5 to 9
call thread1
total = total + i +2
next
end sub
call thread2
call thread2
wait
writeln (Total =, total)
end
Compile the above source code and load it in the main memory. Create a single process, choose RR scheduling algorithm with time quantum of 3 ticks. Run the Process.
Answer the following questions:
a) What is the value of Total?
b) How many processes and how many threads are created?
c) Identify the name of the processes and threads.
d) What is the PID and PPID of the processes and threads created?
e) Represent the parent and child relationship using tree representation

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!