404 views

1 Answer

0 votes
0 votes
Let us consider this scenario -

S and T be binary semaphore, where S=1 and T=1;

Process 1                                                          Process 2

  wait(S)                                                                 wait(T)

  wait(T)                                                                 wait(S)

Critical Section                                                 Critical Section

  signal(T)                                                              signal(S)

  signal(S)                                                              signal(T)

Here if both the processes try to come in the critical section at the same time then both will decrement value of S and T and in the next step they try to decrement value of S and T, then both the processes gets suspended. This situation is deadlock which came due to improper Synchronization

Related questions

12 votes
12 votes
1 answer
2
1 votes
1 votes
2 answers
3