Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following source code program ThreadTest total = 50 sub thread2 as thread for i = 7 to 9 total = total + i

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


Step by Step Solution

3.40 Rating (156 Votes )

There are 3 Steps involved in it

Step: 1

a The value of Total after the program has finished executing is 75 b There is 1 process and 2 threads created c The name of the process is ThreadTest The names of the threads are thread1 and thread2 ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Operating System questions

Question

What is performance measurement?

Answered: 1 week ago

Question

Explain how sleep, exercise, and diet affect memory.

Answered: 1 week ago