512 views

2 Answers

0 votes
0 votes

I am doing like this ...is it correct ???

0 votes
0 votes

i am not getting what you wanna say... but i will answer it.,... take n processes P1,P2,....Pn where pn is different than others

deadlock means all processes should be block, it can't be happened due to

if Pn is out side ====> it can enter at any time

if Pn is inside =====> 1) if No other process inside means Mutex =1 ===> No Problem

                                    2) if Some other processes inside, those process make Mutex=1 when they excute their exit section

 

We are using semaphores, therefore we have queue ===> No Starvation

 

Several Processes executes Critical Section at a time..

assume P1 enters ===> Mutex =0 ===> except Pn no other process can enter

Pn enters ===> Mutex = 1

P2 enters ====> Mutex =0

All these three are in Critical section at a time...


P1 enter ,Pn enter, P2 enter , ----- P1 leave, Pn leave, ----- P1 enter, Pn enter, P3 enter repeat this process you can have many Processes in C.S.

Related questions

0 votes
0 votes
1 answer
1
Abhisek Tiwari 4 asked Jan 21, 2019
555 views
True/FalseSJF and SRTF both suffer from Convoy effect.please tell reason.
0 votes
0 votes
1 answer
2
Rajesh Panwar asked Jan 18, 2019
160 views
Is round robin algorithm suitable for Real Time Operating System?
1 votes
1 votes
1 answer
4
nihal_chourasiya asked Jan 7
187 views
In how many ways can you distribute 4 different choclates to 3 people such that each gets atleast 1 choclate.