Computer Systems: A Programmer's Perspective (3rd Edition)
3rd Edition
ISBN: 9780134092669
Author: Bryant, Randal E. Bryant, David R. O'Hallaron, David R., Randal E.; O'Hallaron, Bryant/O'hallaron
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 8, Problem 8.9HW
Program Plan Intro
Given:
Process | Start time | End Time |
A | 5 | 7 |
B | 2 | 4 |
C | 3 | 6 |
D | 1 | 8 |
Expert Solution & Answer
Explanation of Solution
Determine whether the pair of processes run concurrently or not:
Diagram for processes AB:
Explanation:
- In the above timing diagram, process “A” starts with “5” and end with “7”.
- Process “B” starts with “2” and end with “4”.
- Process “A” and “B” are not concurrent with respect to each other because their corresponding executions do not overlap, that is, process “A” completes before process “B” starts.
Therefore, the processes “AB” are do not run concurrently.
Diagram for processes AC:
Explanation:
- In the above timing diagram, process “A” starts with “5” and end with “7”.
- Process “C” starts with “3” and end with “6”.
- Process “A” and “C” are concurrent with respect to each other because their corresponding executions overlap, that is, process “C” starts before the process “A” completes.
Therefore, the processes “AC” are run concurrently.
Diagram for processes AD:
Explanation:
- In the above timing diagram, process “A” starts with “5” and end with “7”.
- Process “D” starts with “1” and end with “8”.
- Process “A” and “D” are concurrent with respect to each other because their corresponding executions overlap, that is, process “D” starts before the process “A” completes.
Therefore, the processes “AD” are run concurrently.
Diagram for processes BC:
Explanation:
- In the above timing diagram, process “B” starts with “2” and end with “4”.
- Process “C” starts with “3” and end with “6”.
- Process “B” and “C” are concurrent with respect to each other because their corresponding executions overlap, that is, process “C” starts before the process “B” completes.
Therefore, the processes “BC” are run concurrently.
Diagram for processes BD:
Explanation:
- In the above timing diagram, process “B” starts with “2” and end with “4”.
- Process “D” starts with “1” and end with “8”.
- Process “B” and “D” are concurrent with respect to each other because their corresponding executions overlap, that is, process “D” starts before the process “B” completes.
Therefore, the processes “BD” are run concurrently.
Diagram for processes CD:
Explanation:
- In the above timing diagram, process “C” starts with “3” and end with “6”.
- Process “D” starts with “1” and end with “8”.
- Process “C” and “D” are concurrent with respect to each other because their corresponding executions overlap, that is, process “D” starts before the process “C” completes.
Therefore, the processes “CD” are run concurrently.
Completed table:
Process pair | Concurrent? |
AB | No |
AC | Yes |
AD | Yes |
BC | Yes |
BD | Yes |
CD | Yes |
Want to see more full solutions like this?
Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Students have asked these similar questions
assume a system has 6 identical resources
and N processes competing for them. each
process can request at most 2 resources.
what is the maximum value of N for the
system to be deadlock free?
We are dealing with 6 processes p1;p2; : : : ;p6:(a) Processes p1;p2 in p3 arrive at time 2 ms, respectively. Each of those processesneeds 5 ms of CPU time.(b) Process p4 arrives at time 10 ms and needs 3 ms of CPU time.(c) Processes p5 in p6 arrive at time 19 ms. Process p5 needs 7 ms, while process p6needs 4 ms of CPU time.Scheduling is preemptive, where there process switch takes 1 ms. For the Round-Robinalgorithms with quantum 2 ms illustrate the execution of those processes on a timeline.Then determine the average turnaround time.
Let the processes P1, P2, P3, and P4 be given. They arrive in the system at the same time in this order. The processes have the following service times (in time units):
Process
P1
P2
P3
P4
Service time (CPU burst)
53
17
68
24
For the scheduling method "Round Robin" (RR), specify the average execution time (average turnaround time) and the number of context switches. The time quantum q is set to 20 time units. You must show your calculations. You will not have to draw Gantt charts. Note: For RR, processes execute in order of their ID (i.e., P1-P2-P3-P4).
Chapter 8 Solutions
Computer Systems: A Programmer's Perspective (3rd Edition)
Ch. 8.2 - Prob. 8.1PPCh. 8.4 - Prob. 8.2PPCh. 8.4 - Prob. 8.3PPCh. 8.4 - Prob. 8.4PPCh. 8.4 - Practice Problem 8.5 (solution page 797) Write a...Ch. 8.4 - Practice Problem 8.6 (solution page 797) Write a...Ch. 8.5 - Practice Problem 8.7 (solution page 798) Write a...Ch. 8.5 - Prob. 8.8PPCh. 8 - Prob. 8.9HWCh. 8 - In this chapter, we have introduced some functions...
Ch. 8 - How many hello output lines does this program...Ch. 8 - How many "hello' output lines does this program...Ch. 8 - Prob. 8.13HWCh. 8 - How many hello output lines does this program...Ch. 8 - How many "hello lines does this program print?Ch. 8 - Prob. 8.16HWCh. 8 - Prob. 8.17HWCh. 8 - Consider the following program: Determine which of...Ch. 8 - How many lines of output does the following...Ch. 8 - Use execve to write a program called my1s whose...Ch. 8 - What are the possible output sequences from the...Ch. 8 - Write your own version of the Unix system function...Ch. 8 - One of your colleagues is thinking of using...Ch. 8 - Modify the program in Figure 8.18 so that the...Ch. 8 - Write a version of the fgets function, called...
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
- Question 4 Execute SRT for the following group of processes and complete the following table: Process A B C D E TArrival 0 2 4 6 8 Ts 2 3 5 1 4 TFinish Answer Answer Answer Answer Answer TR Answer  Answer  Answer  Answer  Answer  1. If the process arriving has the same remaining execution time as the process in the CPU, then the process that is using the CPU will have the highest priority. 2. If there is no process in the execution state and two or more processes have the shortest remaining time, then you will use the lowest PID criterion (using lexicographical order). Question 5 Execute HRRN for the following group of processes and complete the following table: Process A B C D TArrival 0 2 4 6 Ts 3 5 4 1 TFinish Answer Answer Answer Answer TR Answer  Answer Answer Answer  If two or more processes in the ready queue…arrow_forwardThere are 3 resources R1, R2 and R3 with one instance each and three processes P1, P2 and P3 in an operating system. A snapshot of the system resource allocation graph shows the following: R1 is allocated to P2; R2 is allocated to P1; R3 is allocated to P3; P1 requests R1; P2 requests R3; P3 requests R2. Which of the following is true about this system? answer ) a)Undetermined b)There is deadlock in the system c)Deadlock will never happen d)There is no deadlock in the systemarrow_forwardConsider the following processes:Process Arrival Time Service Time A 0 4 B 1 3 C 2 3 D 2 2 E 3 1 F 5 3 Show (draw the schedule, x-axis is time, and one row for each CPU) how the aboveprocesses execute over time on a system with 2 CPUs. Compute the average turnaroundtime for all processes and the average utilization for each CPU under each of the following schedulers: (a) FCFS with a single Ready Queue. A process gets scheduled once one of the CPUsis available. When both CPUs are available, we select CPU1. (b) FCFS with a Ready Queue per CPU. Processes A, B, and C go to CPU1 and processesD, E, and F go to CPU2. (c) HRRN with a single Ready Queue. A process gets scheduled once one of the CPUsis available. When both CPUs are available, we select CPU1.arrow_forward
- Let the processes P1, P2, P3, and P4 be given. They arrive in the system at the same time in this order. The processes have the following service times (in time units): Process P1 P2 P3 P4 Service time (CPU burst) 53 17 68 24 For the scheduling method "Shortest Job First" (SJF), specify the execution order of the processes, the average execution time (average turnaround time) and the average waiting time over all processes. You must show your calculations. You will not have to draw Gantt charts.arrow_forwardAssuming that there are 5 processes (P1, P2, P3, P4 and P5) which are processed by a CPU.The processes need 3 resources (A, B and C). The following information shows the current resources allocated to each process and also the maximum resources they required in order to complete their processes. Given that the available resources are 4, 2, 2 respectively. Processes Allocated Resources Maximum Resources Required A B C A B C P1 2 1 2 5 3 2P2 3 2 3 6 5 4P3 1 3 4 6 6 6P4 7 8 8 10 18 16P5 6 7 5…arrow_forwardConsider a system consisting of m resources of the same type being shared by n processes, n > m. Each process has a maximum need of m/2 resources. Initially, each process has no resource requests. A process can request or release only one resource at a time. With n=3k and m=2k, for some integer k, show that the system is deadlock free.arrow_forward
- A deadlock occurs when a group of processes is stalled because one process is holding a resource and waiting for another process to obtain it. Consider the situation when two trains are approaching each other on the same track and there is only one track: once they are in front of each other, neither train can proceed. In operating systems, a similar scenario happens when two or more processes possess certain resources while waiting on resources owned by other processes (s). In the picture below, Process 1 is holding Resource 1 and waiting for Process 2 to acquire Resource 2, while Process 2 is waiting for Resource 1. Give an example of a realistic deadlock avoidance approach and describe the basic strategy behind it.arrow_forwardConsider a computer system with 3 processes and one resource with 4 instances. Each process needs at most 2 resource instances. Is a deadlock possible in this system? Justify your answer.arrow_forwardA system has three processes (P1, P2, P3) and three reusable resources (R1, R2, R3). There is one instance of R1, two instances of R2 and three instances of R3. P1 holds an R1 and an R3 and is requesting an R2. P2 holds an R3 and is requesting an R1 and an R2. P3 holds two R2 and an R3 and is requesting an R1. How many cycles are there? Does a deadlokc exist? Why?arrow_forward
- Suppose there are five processes, their arrival time and running time are listed as follows. Adopt FCFS and SJF, respectively, give the schedule order and average waiting time. Give the schedule order of SJF. Compute the average waiting time of SJF. Process Arrival time Running time P1 P2 P3 P4 0 3 4 5 3 10 6 1arrow_forwardConsider the following set of processes, with the length of the CPU burst given in milliseconds: Process Burst Time Priority Arrival Time P1 20 2 0 P2 10 1 1 P3 80 4 2 P4 40 2 3 P5 50 3 4 Draw the GANTT Chart for the schedule of the processes, the waiting time for each process, the average waiting time, the turnaround time for each process and average turnaround time using the following scheduling algorithm.…arrow_forwardIn your opinion what does the term semaphore mean in terms of managing concurrent processes in operating systems. a) consider the case of a non negative counting semaphore S. During an execution, 18P(S) operations and 13 V (S) operations were carried out in some order. What is the largest initial value of S for which at least two P(S) operations are blocked?arrow_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