Assuming that P(occupied) and V(occupied) each takes 1 ms and critical section consists of 4 instructions cr1, cr2, cr3, and cr4 of equal instruction time adding up to 1 ms and noncritical section consists of 4 instructions nc1, nc2, nc3, and nc4 of equal instruction time adding up to 2 ms, (So, for a thread, a cycle is P, cr1, cr2, cr3, cr4, V, nc1, nc2, nc3, nc4, that takes a total of 1 + 1 + 1 + 2 = 5 ms. ) We now change the number of threads to 3 (three) (instead of 2). (a) Suppose OS schedules by round robin of thread 0 for 2ms, thread 1 for 2ms, thread 2 for 2 ms, thread 0 for 2ms, and thread 1 for 2ms, and thread 2 for 2 ms, and so on. This means we have TO, T1, T2, TO, T1, and T2, each for 2 ms. Compute the real amount of time when OS moves among these 3 threads twice as above.. (b) Show which instruction is being executed in thread 0 when thread 0, thread 1, and thread 2 each has been executed twice with 2ms as the time of scheduling. (c) Tabulate and show how much time is spent in each instruction of thread 0 in the first run and in the second run.
Assuming that P(occupied) and V(occupied) each takes 1 ms and critical section consists of 4 instructions cr1, cr2, cr3, and cr4 of equal instruction time adding up to 1 ms and noncritical section consists of 4 instructions nc1, nc2, nc3, and nc4 of equal instruction time adding up to 2 ms, (So, for a thread, a cycle is P, cr1, cr2, cr3, cr4, V, nc1, nc2, nc3, nc4, that takes a total of 1 + 1 + 1 + 2 = 5 ms. ) We now change the number of threads to 3 (three) (instead of 2). (a) Suppose OS schedules by round robin of thread 0 for 2ms, thread 1 for 2ms, thread 2 for 2 ms, thread 0 for 2ms, and thread 1 for 2ms, and thread 2 for 2 ms, and so on. This means we have TO, T1, T2, TO, T1, and T2, each for 2 ms. Compute the real amount of time when OS moves among these 3 threads twice as above.. (b) Show which instruction is being executed in thread 0 when thread 0, thread 1, and thread 2 each has been executed twice with 2ms as the time of scheduling. (c) Tabulate and show how much time is spent in each instruction of thread 0 in the first run and in the second run.
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY