Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Suppose thread A goes through a loop 100 times, each time performing (i) one disk I/O operation, taking 10 milliseconds, and then (ii) some computation,

Suppose thread A goes through a loop 100 times, each time performing (i) one disk I/O operation, taking 10 milliseconds, and then (ii) some computation, taking 1 millisecond. While each 10-millisecond disk operation is in progress, thread A cannot make any use of the processor. Thread B runs for 1 second, purely in the processor, with no I/O. One millisecond of processor time is spent each time the processor switches threads; other than this switching cost, there is no problem with the processor working on thread B during one of thread A’s I/O operations. (The processor and disk drive do not contend for memory access bandwidth, for example.)

(a) Suppose the processor and disk work purely on thread A until its completion, and then the processor switches to thread B and runs all of that thread. What will the total elapsed time be?

(b) Suppose the processor starts out working on thread A, but every time thread A performs a disk operation, the processor switches to B during the operation and then back to A upon the disk operation’s completion. What will the total elapsed time be?

Step by Step Solution

3.54 Rating (147 Votes )

There are 3 Steps involved in it

Step: 1

a Ifthe processor and disk work purely on thread A until its completion and then the processor switches to thread B and runs all of that threadthe total elapsed time will be 100 10ms 1ms 1000ms 2100ms ... 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

Project Management The Managerial Process

Authors: Eric W Larson, Clifford F. Gray

8th Edition

1260570436, 978-1260570434

More Books

Students also viewed these Operating System questions

Question

Can an object be in equilibrium if it is in motion? Explain.

Answered: 1 week ago

Question

How did Singer establish effective patterns of communication?

Answered: 1 week ago