various Synchronization mechanism fails because they were not atomic ..solution like lock variable and turn variable tends to fail as they were Unatomic.
Semaphore are provision given by Operating System in which the Semaphore Operations are always done ATOMICALLY ..
so no variable can be prempted during performing UP and DOWN ..so they will always GIVES MUTX
But they cant assure Progress....
Improper implementation of Semaphore leads to deadlock ..
Say we have P1 and P2 ..2 semaphore variable are S and K so
P1 |
P2 |
Down(S) |
Down(K) |
Down(K) |
Down(S) |
code |
Code |
here process goes to deadlock ...if they perform Down(S) and Down(K) at the same time.\
SO most appropriate answer is D