Question

In: Computer Science

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 time sharing tasks

          iii.              both processes run on a Windows 7 system as variable tasks

          iv.              both processes run on a Windows 7 system as real-time tasks.

Solutions

Expert Solution

i)

Priority inversion problem would occur in the following case:-

Suppose initially the process P2 comes and starts executing the critical section which is residing inside the semaphores and now the higher priority process P1 comes but is not able to enter the critical section as we are using semaphores and also P2 is not able to execute since the CPU gets buzy with process P1 .So,in this case CPU is with process P1 and semaphores are with P2 and hence these processes enter into a deadlock.

ii)

No deadlock would occur in this case as the processes are being executed in time sharing mode so the 2 processes would not interfere with each other.

ii) No deadlock would occur as in variable task so the system would make the other wait process in different location so that it would not interfere with the currently running processses,so deadlock would not occur.

iv)Yes,in this case deadlock can occur as the both the processes would be real time so they would be wanting to finish their work as early as possible so in this case deadlock would be possible as one process would not wait for the other process to finish first.


Related Solutions

Turner Inc. produces two products P1 and P2. The company has provided you with the following...
Turner Inc. produces two products P1 and P2. The company has provided you with the following information. Assume that the current sales volume of P1 and P2 reflects the long run sales mix of the firm. P1 P2 Selling price per unit $30 $60 Variable cost per unit $10 $30 # of units sold 9,000 6,000 Total fixed costs $240,000 Select ALL statements that are TRUE. All numbers in the answer choices are rounded off to 2 decimals. Breakeven volume...
Turner Inc. produces two products P1 and P2. The company has provided you with the following...
Turner Inc. produces two products P1 and P2. The company has provided you with the following information. Assume that the current sales volume of P1 and P2 reflects the long run sales mix of the firm. P1 P2 Selling price per unit $30 $60 Variable cost per unit $10 $30 # of units sold 9,000 6,000 Total fixed costs $240,000 Select ALL statements that are TRUE. All numbers in the answer choices are rounded off to 2 decimals. Breakeven volume...
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.
A company produces a product in two departments, P1 and P2. The company has two support...
A company produces a product in two departments, P1 and P2. The company has two support departments, S1 and S2. The company allocates S1 costs to other departments based on square meters and S2 costs based on machine hours. SUPPORT DEPARTMENTS PRODUCTION DEPARTMENTS S1 S2 P1 P2 TOTAL COSTS    500 120 350 150 1,120 SQUARE METERS 1000 1600 2400 4000 9000 MACHINE HOURS 200 375 1600 200 2375 TOTAL COSTS 500 120 350 150 1,120 a) (20 pts) Use the...
P1=4x-z-3, p2=x+2y+z a) The two planes P1 and P2 will intersect in a line. Find the...
P1=4x-z-3, p2=x+2y+z a) The two planes P1 and P2 will intersect in a line. Find the Cartesian coordinate of the point at which the two planes P1 and P2 intersect and x = 0 b) find the vector equation of a line which is the intersection of the two planes P1 and P2.
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...
Leader Company has two support departments (S1 and S2) and two producing departments (P1 and P2)....
Leader Company has two support departments (S1 and S2) and two producing departments (P1 and P2). Estimated direct costs and percentages of services used by these departments are as follows: Allocation of support departments S1 S2 P1 P2 S1              - 10% 40% 50% S2 20% - 50% 30% Direct costs £4,500 £8,000 £10,000 £15,000         Required: a. Prepare a schedule allocating the support department costs to the producing departments using the direct allocation method. b. Prepare a schedule allocating the support...
Leader Company has two support departments (S1 and S2) and two producing departments (P1 and P2)....
Leader Company has two support departments (S1 and S2) and two producing departments (P1 and P2). Estimated direct costs and percentages of services used by these departments are as follows: Allocation of support departments S1 S2 P1 P2 S1              - 10% 40% 50% S2 20% - 50% 30% Direct costs £4,500 £8,000 £10,000 £15,000         Required: a. Prepare a schedule allocating the support department costs to the producing departments using the direct allocation method. b. Prepare a schedule allocating the support...
Craylon Corp has two service departments, S1 and S2, and two production departments, P1 and P2....
Craylon Corp has two service departments, S1 and S2, and two production departments, P1 and P2. The data for April were as follows: Services provided to: Activity Costs S1 S2 P1 P2 S1 $100,000 25% 40% 35% S2 $80,000 10% 55% 35% Fixed Costs P1 $400,000 P2 $500,000 One of the algebraic equations in linear form for an activity using the reciprocal method is S2 = 80,000 +.25S1 S1=100,000 + .25S2 S2 = 80,000 + .35S1 S1 = 100,000 +.10S2
Leader Company has two support departments (S1 and S2) and two producing departments (P1 and P2)....
Leader Company has two support departments (S1 and S2) and two producing departments (P1 and P2). Estimated direct costs and percentages of services used by these departments are as follows: Allocation of support departments S1 S2 P1 P2 S1              - 10% 40% 50% S2 20% - 50% 30% Direct costs £4,500 £8,000 £10,000 £15,000         Required: a. Prepare a schedule allocating the support department costs to the producing departments using the direct allocation method. b. Prepare a schedule allocating the support...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT