Introduction to Algorithms
3rd Edition
ISBN: 9780262033848
Author: Thomas H. Cormen, Ronald L. Rivest, Charles E. Leiserson, Clifford Stein
Publisher: MIT Press
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 16.5, Problem 1E
Program Plan Intro
Program Plan:To get the solution of scheduling problem where each penalty wi is replaced by 80- wi.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
2.18 Consider the following program:
co < await (x > 0) x-x- 1; >
// < await (x < 0).x=x+2; >
// <await (x==0) x=x-1;>
oc
For what initial values of x does the program terminate, assuming scheduling is weakly fair? What are the corresponding final values? Explain your answer.
(i) Describe Banker’s algorithm for deadlock avoidance with supporting example
Consider a computer system with has four identical units of a resource R. There are three processes each with a maximum claim of two units of resource R. Processes can request these resources in anyway, that is, two in one shot or one by one. The system always satisfies a request a request for a resource if enough resources are available. If the process doesn’t request any other kind of resource, show that the system never deadlock
Give a solution for the following synchronization problem using semaphores
Producer- Consumer Problem
Readers- Writers Problem
List out the issues in preprocessor scheduling that causes performance degradation in multiprocessor systems
a) Create wait for graph from the below resource allocation graph.
b) Is it possible to solve the deadlock problem by using CPU scheduling? Give valuable answer with suitable argument.
Chapter 16 Solutions
Introduction to Algorithms
Ch. 16.1 - Prob. 1ECh. 16.1 - Prob. 2ECh. 16.1 - Prob. 3ECh. 16.1 - Prob. 4ECh. 16.1 - Prob. 5ECh. 16.2 - Prob. 1ECh. 16.2 - Prob. 2ECh. 16.2 - Prob. 3ECh. 16.2 - Prob. 4ECh. 16.2 - Prob. 5E
Ch. 16.2 - Prob. 6ECh. 16.2 - Prob. 7ECh. 16.3 - Prob. 1ECh. 16.3 - Prob. 2ECh. 16.3 - Prob. 3ECh. 16.3 - Prob. 4ECh. 16.3 - Prob. 5ECh. 16.3 - Prob. 6ECh. 16.3 - Prob. 7ECh. 16.3 - Prob. 8ECh. 16.3 - Prob. 9ECh. 16.4 - Prob. 1ECh. 16.4 - Prob. 2ECh. 16.4 - Prob. 3ECh. 16.4 - Prob. 4ECh. 16.4 - Prob. 5ECh. 16.5 - Prob. 1ECh. 16.5 - Prob. 2ECh. 16 - Prob. 1PCh. 16 - Prob. 2PCh. 16 - Prob. 3PCh. 16 - Prob. 4PCh. 16 - Prob. 5P
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Operation system 1) Draw the scheduling chart for Round Robin (RR) with time quantum = 2. 2) Compute the average waiting time.arrow_forwardConsider the following set of processes, with the length of the CPU burst given in milliseconds Process Burst Time Priority P1 5 1 P2 2 3 P3 1 3 P4 1 2 P5 10 4 The processes are assumed to have arrived in the order P1, P2, P3, P4, P5 all at time 0. Draw four Gantt charts that illustrate the execution of these processes using the following scheduling algorithms: FCFS, SJF, and RR (quantum = 3). What is the turnaround time of each process for each of the scheduling algorithms in part a? what is the waiting time of each process for each of the scheduling algorithms in part a? Which of the algorithms results in the minimum average waiting time (over all processes)?arrow_forwardConsider the following set of processes, with the length of the CPU burst given in seconds: Process Burst time Arrival time P1 10 1 P2 04 2 P3 05 3 P4 03 4 Draw four Gantt charts that illustrate the execution of these processes using the following scheduling algorithms: FCFS, SJF preemptive and Round Robin (quantum = 3). What is the turnaround time of each process for each of the scheduling algorithms in part a? What is the waiting time of each process for each of these scheduling algorithms? Which of the algorithms results in the minimum average waiting time (over all processes)? Which of the algorithms results in the minimum average turnaround time (over all processes)?arrow_forward
- Suppose you have 3 machines and 9 jobs, with the following lengths:5, 1, 5, 5, 6, 4, 2, 4, 5 Use Graham's algorithm to schedule the jobs and show the load for each machine. What is the makespan? Use the Longest Processing Time version of Graham's algorithm to schedule the jobs and show the load for each machine. What is the makespan? Find a different schedule that has a lower makespan than both of the schedules previously created.arrow_forward1. Explain the differences in the degree to which the following scheduling algorithms discriminate in favor of short processes: FCFS RR 2. Give a practical example how dead lock occurs.arrow_forwardAs you talk about the different scheduling algorithms, think about (a) waiting time, (b) starvation, (c) turnaround time, and d) the variance in turnaround time for each one.arrow_forward
- Consider the following resource allocation graph and choose the correct answer:arrow_forwardconsider the following set of processes with the length of the cpu burst time in given ms: process burst time arrival time p1 8 0.00 p2 4 1.001 p3 9 2.001 p4 5 3.001 p5 3 4.001 a) draw four gantt chart illustrtaing the exaction of these processes using FCFS SJF PRIORITY and RR (quantum=2) scheduling b) also calculate waiting time and turnaround time for each scheduling algorithmsarrow_forwardUsing a resource allocation graph, show the possibility of a deadlock in this implementation. Modify the order of some of the get requests to prevent the possibility of any deadlock. Is it possible that a resource deadlock involves multiple units of one type and a single unit of another? If so, give an example.arrow_forward
- Given a Resource Allocation Graph G with i processes Pi and j Resources Rj; graph G shows a particular situation at any time. Under which condition of G is it clear that a deadlock cannot occur?arrow_forwardConsider the following snapshot of a system: ALLOCATION MAX AVAILABLE A B C D A B C D A B C D P0 3 2 1 4 3 4 2 7 4 4 3 1 P1 2 5 4 3 4 7 7 6 P2 3 1 1 2 5 3 2 3 P3 2 4 2 3 2 5 3 5 P4 4 2 3 2 6 3 6 3 Answer the following questions using the banker’s algorithm: Illustrate that the system is in a safe state by demonstrating an order in which the processes may complete. If a request from process P4 arrives for (2,2,1,1), can the request be granted immediately? If a request from process P1 arrives for (1,1,3,1), can the request be granted immediately?arrow_forwardConsider the following set of processes, with the length of the CPU burst given in seconds: Process Burst Priority P1 32 4 P2 24 1 P3 4 2 P4 36 2 P5 12 3 NOTE: The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0. Draw four Gantt charts that illustrate the execution of these processes using the following scheduling algorithms: FCFS, SJF, non-preemptive priority (a larger priority number implies a higher priority), and Round Robin (quantum = 8). What is the turnaround time of each process for each of the scheduling algorithms in part a? What is the waiting time of each process for each of these scheduling algorithms? Which of the algorithms results in the minimum average waiting time (over all processes)? Which of the algorithms results in the minimum average turnaround time (over all processes)? NOTE: Write the code of all partsarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education