Consider the following source code program ThreadTest total = 50 sub thread2 as thread for i =
Question:
Consider the following source code
program ThreadTest
total = 50
sub thread2 as thread
for i = 7 to 9
total = total + i
next
end sub
sub thread1 as thread
for i = 1 to 2
total = total + i
call thread2
next
end sub
call thread1
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 5 seconds with no-priority. 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
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill