Experiment 3 resource allocation management Aim: deepen the understanding and grasp of the concept of deadlock understand the essence and implementation process of banker's algorithm. Task Five processes (PO, P1, P2, P3, P4) are designed to share three kinds of resources (A, B, C}. The number of resources in (A, B, C} is 10, 5 and 7, respectively. Resources can be allo cated dynamically according to the process request. The resource allocation at t0 is sho wn in the following table: МАХ Allocation Process Available ABC ABC PO 7,5,3 0,1,0 3,3,2 P1 3,2,2 2,0,0 P2 9,0,2 3,0,2 211

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...
icon
Related questions
Question
Experiment 3 resource allocation management
Aim:
deepen the understanding and grasp of the concept of deadlock
understand the essence and implementation process of banker's algorithm.
Task
Five processes (PO, P1, P2, P3, P4) are designed to share three kinds of resources (A, B,
C). The number of resources in {A, B, C} is 10, 5 and 7, respectively. Resources can be allo
cated dynamically according to the process request. The resource allocation at t0 is sho
wn in the following table:
МАX
Allocation
Process
Available
ABC
ABC
PO
7,5,3
0,1,0
3,3,2
P1
3,2,2
2,0,0
P2
9,0,2
3,0,2
P3
2,2,2
2,1,1
P4
4,3,3
0,0,2
1) Find a safe sequence at the current time using Banker's algorithm.
2) If process P2 make a Request2(0, 1, 0), can the request be granted immediately?
Transcribed Image Text:Experiment 3 resource allocation management Aim: deepen the understanding and grasp of the concept of deadlock understand the essence and implementation process of banker's algorithm. Task Five processes (PO, P1, P2, P3, P4) are designed to share three kinds of resources (A, B, C). The number of resources in {A, B, C} is 10, 5 and 7, respectively. Resources can be allo cated dynamically according to the process request. The resource allocation at t0 is sho wn in the following table: МАX Allocation Process Available ABC ABC PO 7,5,3 0,1,0 3,3,2 P1 3,2,2 2,0,0 P2 9,0,2 3,0,2 P3 2,2,2 2,1,1 P4 4,3,3 0,0,2 1) Find a safe sequence at the current time using Banker's algorithm. 2) If process P2 make a Request2(0, 1, 0), can the request be granted immediately?
CPU SCHEDULING ALGORITHMS- FIRST COME FIRST SERVE
AIM:
To write a c program to simulate the CPU scheduling algorithm First Come Fir
st Serve (FCFS)
DESCRIPTION:
To calculate the average waiting time using the FCFS algorithm f ist the waitin
g time of the f rst process is kept zero and the waiting time of the second proc
ess is the burst time of the fist process and the waiting time of the third proce
ss is the sum of the burst times of the f ist and the second process and so on.
After calculating all the waitingtimes the average waiting time is calculated as
the average of all the waiting times. FCFS mainly says fist come f ist serve th
e algorithm which came first will be served first.
ALGORITHM:
Step 1: Start the process
Step 2: Accept the number of processes in the ready Queue
Step 3: For each process in the ready Q, assign the process name and the burs
t time
Step4: Set the waiting of the fist process as_0'and its burst time as its turnaro
und time
Step5: for each process in the Ready Q calculate
a). Waiting time (n) = waiting time (n-1) + Burst time (n-1) b).
Turnaround time (n)= waiting time(n)+Burst time(n)
Step 6: Calculate
a) Average waiting time Total waiting Time / Number of process
b) Average Tumaround time Total Turnaround Time / Number of process
Step 7: Stop the process
Transcribed Image Text:CPU SCHEDULING ALGORITHMS- FIRST COME FIRST SERVE AIM: To write a c program to simulate the CPU scheduling algorithm First Come Fir st Serve (FCFS) DESCRIPTION: To calculate the average waiting time using the FCFS algorithm f ist the waitin g time of the f rst process is kept zero and the waiting time of the second proc ess is the burst time of the fist process and the waiting time of the third proce ss is the sum of the burst times of the f ist and the second process and so on. After calculating all the waitingtimes the average waiting time is calculated as the average of all the waiting times. FCFS mainly says fist come f ist serve th e algorithm which came first will be served first. ALGORITHM: Step 1: Start the process Step 2: Accept the number of processes in the ready Queue Step 3: For each process in the ready Q, assign the process name and the burs t time Step4: Set the waiting of the fist process as_0'and its burst time as its turnaro und time Step5: for each process in the Ready Q calculate a). Waiting time (n) = waiting time (n-1) + Burst time (n-1) b). Turnaround time (n)= waiting time(n)+Burst time(n) Step 6: Calculate a) Average waiting time Total waiting Time / Number of process b) Average Tumaround time Total Turnaround Time / Number of process Step 7: Stop the process
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
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 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)
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
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY