in Operating System
1,025 views
3 votes
3 votes
wait(S);

Critical section

wait(S);

S is a binary semaphore initialised to 1. Suppose there are n processes competing for the CS. Only one can enter into it. Is this the situation of deadlock or starvation?

I think it's deadlock because other processes are made to wait infinitely. But someone told me that since at least one process is getting executed so it's not deadlock as in case of deadlock none of the processes can proceed.

Please clarify.
in Operating System
1.0k views

4 Comments

Shubhanshu NO it is one way. Deadlock -> Starvation i.e. starvation freedom -> no deadlock

0
0
Bounded waiting:- it is the factor of the number of processes.

Starvation:- It is the factor of time.

I think that's why we can't say that BW $\leftarrow\rightarrow$ Starvation.
1
1
@Anu007 and @Subhanshu

But can you give example to show that

1. There is no starvation but still there is bounded waiting

2. There is bounded waiting but still process may suffer from starvation.

I couldn't think of such example so I thought what Shubhanshu said was correct.
0
0

Please log in or register to answer this question.

Related questions