![]() ![]() Deadlock occurs because there can be more than one process which are holding one resource and waiting for other in the cyclic order. Hold and wait condition lies when a process holds a resource and waiting for some other resource to complete its task. Therefore, we cannot violate mutual exclusion for a process practically. We cannot force a resource to be used by more than one process at the same time since it will not be fair enough and some serious problems may arise in the performance. After some point of time, there may arise a race condition between the processes to get space in that spool.This cannot be applied to every resource.Later, it collects the output when it is produced.Īlthough, Spooling can be an effective approach to violate mutual exclusion but it suffers from two kinds of problems. By using this mechanism, the process doesn't have to wait for the printer and it can continue whatever it was doing. Later, Printer collects all the jobs and print each one of them according to FCFS. ![]() There is a memory associated with the printer which stores jobs from each of the process into it. Spoolingįor a device like printer, spooling can work. However, if we can be able to violate resources behaving in the mutually exclusive manner then the deadlock can be prevented. If a resource could have been used by more than one process at the same time then the process would have never been waiting for any resource. Mutual section from the resource point of view is the fact that a resource can never be used by more than one process simultaneously which is fair enough but that is the main reason behind the deadlock. Let's see how we can prevent each of the conditions. The same happens with deadlock, if we can be able to violate one of the four necessary conditions and don't let them occur together then we can prevent the deadlock. However, if we break one of the legs of the table then the table will fall definitely. If we simulate deadlock with a table which is standing on its four legs then we can also simulate four legs with the four conditions which when occurs simultaneously, cause the deadlock.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |