Deadlocks

Read Complete Research Material

DEADLOCKS

Deadlocks



Deadlocks

Introduction

Recall that one definition of an operating system is a resource allocator. There are many resources that can be allocated to only one process at a time, and we have seen several operating system features that allow this, such as mutexes, semaphores or file locks.

Discussion

Sometimes a process has to reserve more than one resource. For example, a process which copies files from one tape to another generally requires two tape drives. A process which deals with databases may need to lock multiple records in a database.

In general, resources allocated to a process are not preemptable; this means that once a resource has been allocated to a process, there is no simple mechanism by which the system can take the resource back from the process unless the process voluntarily gives it up or the system administrator kills the process. This can lead to a situation called deadlock. A set of processes or threads is deadlocked when each process or thread is waiting for a resource to be freed which is controlled by another process. Here is an example of a situation where deadlock can occur. Recall that one definition of an operating system is a resource allocator. There are many resources that can be allocated to only one process at a time, and we have seen several operating system features that allow this, such as mutexes, semaphores or file locks.

Sometimes a process has to reserve more than one resource. For example, a process which copies files from one tape to another generally requires two tape drives. A process which deals with databases may need to lock multiple records in a database.

In general, resources allocated to a process are not preemptable; this means that once a resource has been allocated to a process, there is no simple mechanism by which the system can take the resource back from the process unless the process voluntarily gives it up or the system administrator kills the process. This can lead to a situation called deadlock. A set of processes or threads is deadlocked when each process or thread is waiting for a resource to be freed which is controlled by another process.

Traffic gridlock is an everyday example of a deadlock situation.

In order for deadlock to occur, four conditions must be true.

Mutual exclusion

Each resource is either currently allocated to exactly one process or it is available. (Two processes ...
Related Ads
  • Repression
    www.researchomatic.com...

    As societies eliminate varieties of repression, some ...

  • Asymmetric Morita Baylis ...
    www.researchomatic.com...

    Deadlock freedom and lockout freedom state th ...

  • Network Traffic Routing U...
    www.researchomatic.com...

    In this paper, we suggest a methodology for conceive ...

  • Abortion
    www.researchomatic.com...

    Abortion may or may not be a murder, but the debate ...

  • Scheduling In Windows
    www.researchomatic.com...

    In an operating system, a deadlock is the nam ...