Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Part III: Multi-Threading Consider the following source code program ThreadTest total = 100 sub thread1 as thread for i = 1 to 2 total =
Part III: Multi-Threading
Consider the following source code
program ThreadTest
total = 100
sub thread1 as thread
for i = 1 to 2
total = total - i
next
end sub
sub thread2 as thread
for i = 3 to 4
total = total + i
call thread1
next
end sub
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:
- What is the value of Total?
- How many processes and how many threads are created?
- Identify the name of the processes and threads.
- What is the PID and PPID of the processes and threads created?
- Represent the parent and child relationship using tree representation.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started