Skip to main content

Definition of Deadlock In Operating System

Deadlock in operating system


A set of process is in a deadlock state if each process in the set is waiting for an event that can be caused by only another process in the set. In other words, each member of the set of deadlock processes is waiting for a resource that can be released only by a deadlock process.

None of the processes can run, none of them can release any resources, and none of them can be awakened. It is important to note that the number of processes and the number and kind of resources possessed and requested are unimportant.

The resources may be either physical or logical. Examples of physical resources are Printers, Tape Drivers, Memory Space, and CPU Cycles. Examples of logical resources are Files, Semaphores, and Monitors.

Example:

The simplest example of deadlock is where process 1 has been allocated non-shareable resources A, say, a tap drive, and process 2 has be allocated non-shareable resource B, say, a printer. Now, if it turns out that process 1 needs resource B (printer) to proceed and process 2 needs resource A (the tape drive) to proceed and these are the only two processes in the system, each is blocked the other and all useful work in the system stops.

This situation ifs termed deadlock. The system is in deadlock state because each process holds a resource being requested by the other process neither process is willing to release the resource it holds.

Preemptable and Nonpreemptable Resources:


 Resources come in two flavors:
  •  A preemptable resource is one that can be taken away from the process with no ill effects. Memory is an example of a preemptable resource.
  •  A non-preemptable resource is one that cannot be taken away from process (without causing ill effect).For example, CD resources are not preemptable at an arbitrary moment. Reallocating resources can resolve deadlocks that involve preemptable resources.
Example of Deadlock

Comments

  1. Deadlock in an operating system occurs when two or more processes are stuck in a state where they can't proceed because each is waiting for the other to release resources. If you're looking for detailed explanations or solutions to prevent deadlocks, Club Hosty offers valuable insights and resources to help manage system processes effectively.

    ReplyDelete

Post a Comment

Popular posts from this blog

3.1.1 Identify Between Resident And Transient Routines

Memory Management Memory management is concerned with managing: The computer’s available pool of memory Allocating space to application routines and making sure that they do not interfere with each other. 3.1.1 Identify between resident and transient routines The operating system is a collection of software routines. Resident routines Transient routines Routines that directly support application programs as they run Stored on disk and read into memory only when needed Example: routine that control physical I/O Example: routine that formats disks The operating system occupies low memory beginning with address 0. Key control information comes first followed by the various resident operating system routines. The remaining memory, called the transient area, is where application programs and transient operating system routines are loaded. Resident & transient routines structure...

Operating Systems Definition and the Classification of OS

             OPERATING SYSTEMS ( OS ) What is an operating system? An operating system (sometimes abbreviated as "OS") is the program that, after being initially loaded into the computer by a boot program, manages all the other programs in a computer. The other programs are called applications or application programs. The application programs make use of the operating system by making requests for services through a defined application program interface (API). In addition, users can interact directly with the operating system through a user interface such as a command language or a graphical user interface (GUI). An operating system performs these services for applications:     In a multitasking operating system where multiple programs can be running at the same time, the operating system determines which applications should run in what order and how much time should be allowed for each application before g...

2.1.4 Distinguish between logical I/O and physical I/O

2.1.4 Distinguish between logical I/O and physical I/O logical input relate to hard disk Logical I/O an Physical I/O Physical" I/O is an actual fetch of data from a storage device such as a disk. Logical" I/O is a programmatic request for data satisfied by a memory (block, buffer) access. A logical I/O may cause a physical I/O in the first place, or a logical I/O may retrieve a part of a block (buffer) of data from memory. 2.1.5 Distinguish between directory management and disk space management. Directory management A directory is a hierarchical collection of directories and files.  The only constraint on the number of files that can be contained in a single directory is the physical size of the disk on which the directory is located. Disk management A hard disk is a rigid disk inside a computer that stores and provides relatively quick access to large amounts of data. It is the type of storage most often used with Windows. The system also supp...