Question

In: Computer Science

Assuming that there are 9 processes in a distributed system numbered p1, p2, ..., p9. Describe...

Assuming that there are 9 processes in a distributed system numbered p1, p2, ..., p9. Describe a situation where deadlock may occur when using Maekawa’s algorithm in this system.

Solutions

Expert Solution

Meakawas algorithm has 3 msgs reply,request and release msg

every site can send a request msg only from the subset sites

request subsets of every site is selected such that request subsets are disjoint , at least one element will be in common

one time one reply msg can be sent by a site

a site can send a reply msg only after getting release msg from a previous reply msg

to construct request sets we have 4 methods

m1: 2 request subsets are disjoint

m2: si belongs to Ri ie every site is under the request set

m3 : size of a request set is equal to k

M4:. Every site or process has k number of request set

Now to enter critical situation

All sites of request set wil get request msg

I will send reply msg to a request msg only when i have not sent any reply msg after a release msg

If not the request msg will be stored in a queue

Performance 3 rootN no of msgs ie root N no of msgs each for reply, request and response msg

The picture shows 9 processes in a distributive system

In all 5 distributions ie p4 to p1

P5 to p2

P6 to p3

P7to p9

P9 to p8 we come across deadlocks as. P4 sent reply msg to p1 and cannot send to any other process such as p2 and p2 will be deadlocked being waiting for reply msg from p1

Similarly p5 sends reply msg to p2 whereas p3 enters deadlock situation by waiting for rply msg from p5

P1 Waits for all 3 reply msgs from p1,p4 and p6

Thus enter deadlock by waiting for p6 reply msg which is already sent by p6 to p3

As according to meakawas algo one process can send only 1 reply msg at a time

P3 waits for reply msg from p5 and p5 has sent msg to p2 and so on.


Related Solutions

Assume you have two processes, P1 and P2. P1 has a high priority, P2 has a...
Assume you have two processes, P1 and P2. P1 has a high priority, P2 has a low priority. P1 and P2 have one shared semaphore (i.e., they both carry out waits and posts on the same semaphore). The processes can be interleaved in any arbitrary order (e.g. P2 could be started before P1).             i.             Explain the problem with priority inversion Briefly explain whether the processes could deadlock when:            ii. both processes run on a Linux system as...
U=(q1q2)0,5 Y= 70 p1=4$ p2=9$ P1 increases to 9$ calculate the compensation variation.
U=(q1q2)0,5 Y= 70 p1=4$ p2=9$ P1 increases to 9$ calculate the compensation variation.
Consider following four processes arriving in the order of P1, P2, P3 and P4. Process   Arrival...
Consider following four processes arriving in the order of P1, P2, P3 and P4. Process   Arrival Time CPU burst Time P1             0.0     6 P2    0.0                              8 P3              0.0                                7 P4              0.0                                 3 What is the average waiting time for RR scheduling (time quantum = 5)? What is the average waiting time for SJF scheduling? What is the average waiting time for FCFS scheduling?
6.1) Consider 3 processes, P1, P2, and P3, all available at time 2, 0, 3, respectively,...
6.1) Consider 3 processes, P1, P2, and P3, all available at time 2, 0, 3, respectively, with the CPU bursts as 6, 9, and 4, respectively, what would be the turnaround time for each of the processes and what would be the average turnaround time for those 3 processes if SJF (Shortest Job First) CPU scheduling algorithm were used? (5 points) 6.2) Based on the same scenario given in the previous question, what would be the turnaround time for each...
6. Consider the following set of processes P1, P2, P3, P4. Process Burst Time Arrival Time...
6. Consider the following set of processes P1, P2, P3, P4. Process Burst Time Arrival Time Priority P1 3 0 1 P2 5 1 2 P3 8 3 3 P4 4 4 2 a) Draw Gantt charts that illustrate the execution of these processes using the following scheduling algorithms: first-come, first-served (FCFS), priority scheduling (larger number=high priority), and Round-Bobin (RR, quantum=2). b) Compute the average waiting time, turnaround time for the three algorithms. Turnaround time – amount of time to...
1.) You are given 4 processes P1,P2, P3, P4 all ariving at the same time t=0,...
1.) You are given 4 processes P1,P2, P3, P4 all ariving at the same time t=0, in a dual-processor SMP. (The two CPUs are referred to as CPU-0 and CPU-1.) The service time for each process is 40s, 20s, 20s and 10s respectively (a) What are the possibilities for the turnaround time of the job that includes the execution of all 4 processes? You may assume that each service time is just CPU time and no process interferes with the...
2.  [17: 20, 10, 2, 1] Find the Banzhaf power distribution for this system. P1:                  P2:         
2.  [17: 20, 10, 2, 1] Find the Banzhaf power distribution for this system. P1:                  P2:                  P3:                  P4:
Required information Exercise 6-9 Income statement under absorption costing and variable costing LO P1, P2 [The...
Required information Exercise 6-9 Income statement under absorption costing and variable costing LO P1, P2 [The following information applies to the questions displayed below.] Cool Sky reports the following costing data on its product for its first year of operations. During this first year, the company produced 44,000 units and sold 36,000 units at a price of $120 per unit.    Manufacturing costs Direct materials per unit $ 48 Direct labor per unit $ 18 Variable overhead per unit $...
Deadlock –Banker’s Algorithm A system has three resource types (A, B, C) and four processes {P1,...
Deadlock –Banker’s Algorithm A system has three resource types (A, B, C) and four processes {P1, P2, P3, P4 }. The total units of system resources are: (8, 5, 4) units of A, B and C, respectively. The maximum demands for each process is P1(1,2,3), P2(3,2,1), P3(6,5,4) and P4(4,4,2). The current allocation is: P1(0,1,1), P2(2,2,0) and P3(3,0,1) and P4(1,0,1). (a) Allocation table is given for the 3 processes with the following four columns: PROCESS, ALLOCATION, MAX and NEED. And fill...
Problem 14-2A Straight-Line: Amortization of bond discount LO P1, P2 Hillside issues $2,900,000 of 9%, 15-year...
Problem 14-2A Straight-Line: Amortization of bond discount LO P1, P2 Hillside issues $2,900,000 of 9%, 15-year bonds dated January 1, 2017, that pay interest semiannually on June 30 and December 31. The bonds are issued at a price of $2,505,923. Required: 1. Prepare the January 1, 2017, journal entry to record the bonds’ issuance. 2(a) For each semiannual period, complete the table below to calculate the cash payment. 2(b) For each semiannual period, complete the table below to calculate the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT