Friday, February 5, 2010

Case 7: Deadlocks in a Network

Case 7: Deadlocks in a Network

          A network that’s congested (or filled large % of its I/O buffer space) can become deadlocked if it doesn’t have protocols to control flow of messages through network.


Case 6 : Deadlocks in Disk Sharing

Case 6 : Deadlocks in Disk Sharing

Disks are designed to be shared, so it’s not uncommon for 2 processes access different areas of same disk.
Without controls to regulate use of disk drive, competing processes could send conflicting commands and deadlock the system.

Case 5 : Deadlocks in Spooling

Case 5 : Deadlocks in Spooling

Most systems have transformed dedicated devices such as a printer into a sharable device by installing a high-speed device, a disk, between it and the CPU.
Disk accepts output from several users and acts as a temporary storage area for all output until printer is ready to accept it (spooling).
If printer needs all of a job's output before it will begin printing, but spooling system fills available disk space with only partially completed output, then a deadlock can occur.

Case 4 : Deadlocks in Multiple Device Allocation

Case 4 : Deadlocks in Multiple

Device Allocation

Deadlocks can happen when several processes request, and hold on to, dedicated devices while other processes act in a similar manner.

Example:


Case 3: Deadlocks in Dedicated Device Allocation

Case 3: Deadlocks in Dedicated Device Allocation

          Deadlock can occur when there is a limited number of dedicated devices.

          E.g., printers, plotters or tape drives.

 Example:

1.            P1 requests tape drive 1 and gets it.

2.            P2 requests tape drive 2 and gets it.

3.            P1 requests tape drive 2 but is blocked.

4.            P2 requests tape drive 1 but is blocked.

Case 2 : Deadlocks in Databases

Case 2 : Deadlocks in Databases

          Deadlock can occur if 2 processes access & lock records in database.

          3 different levels of locking :

        entire database for duration of request

        a subsection of the database

        individual record until process is completed.

          If don’t use locks, can lead to a race condition.

Example:

1.            P1 accesses R1 and locks it.

2.            P2 accesses R2 and locks it.

3.            P1 requests R2, which is locked by P2.

4.            P2 requests R1, which is locked by P1.

 

Case 1 : Deadlocks on File Requests


Case 1 : Deadlocks on File Requests

          If jobs can request and hold files for duration of their execution, deadlock can occur.

          Any other programs that require F1 or F2 are put on hold as long as this situation continues.

          Deadlock remains until a programs is withdrawn or forcibly removed and its file is released.

Example:




Followers