31436 Systems Software - PowerPoint PPT Presentation

1 / 16
About This Presentation
Title:

31436 Systems Software

Description:

The technique of managing several processes in the system at the same time. ... No pre-emption. Conditions necessary for deadlock: Circular wait. Daniel COMARMOND ... – PowerPoint PPT presentation

Number of Views:20
Avg rating:3.0/5.0
Slides: 17
Provided by: danielco
Category:

less

Transcript and Presenter's Notes

Title: 31436 Systems Software


1
31436 Systems Software NetworksAUTUMN 2002
  • Tutorial 5
  • Concurrency Deadlock

2
What is Concurrency?
  • Concurrency is multitasking!
  • The technique of managing several processes in
    the system at the same time.
  • The illusion that two or more processes are
    executing at the same time.

3
What is Deadlock?
  • A situation where two or more processes are
    unable to proceed because each is waiting for one
    of the others to do something.
  • This set of processes is blocked permanently.
  • Deadlock is immediately preceded by circular wait.

4
Conditions for Deadlock
  • Conditions to be present for deadlock
  • Mutual exclusion
  • Hold and Wait
  • No pre-emption
  • Conditions necessary for deadlock
  • Circular wait

5
QUESTION 1
  • Why is deadlock an important issue for system
    operation?

6
Deadlock is Important!
  • Once in deadlock, the affected processes can
    never run to completion.
  • All resources held by the processes at the time
    of deadlock are not released.
  • This may cause other processes to go into a state
    of deadlock as resources run out.
  • Worst case Deadlock in a busy-wait loop.
  • Unnecessary usage of the CPU.

7
QUESTION 2
  • What is the difference among
  • Deadlock Avoidance
  • Deadlock Detection
  • Deadlock Prevention

8
Deadlock Avoidance
  • A dynamic technique that examines each new
    resource request for deadlock.
  • Allows the three conditions for deadlock.
  • If a new resource request could lead to a
    deadlock, then the request is denied.
  • Deadlock avoidance thus allows more concurrency
    than prevention.

9
Deadlock Detection
  • A technique in which requested resources are
    always granted when available.
  • No restrictions set on access to resources.
  • Periodically, the operating system runs the
    deadlock detection algorithm to detect the
    circular wait condition.

10
Deadlock Prevention
  • A technique that guarantees that a deadlock will
    not occur.
  • Prevention is achieved by assuring that one of
    the necessary conditions for deadlock is not met.
  • However, mutual exclusion cannot be disabled.

11
QUESTION 3
  • Three processes share four resources of the same
    type each requiring at most two.
  • Bill says that you must introduce a deadlock
    detection algorithm in this system.
  • Convince Bill that he is wrong.

12
Bill Sucks!
  • Scenario 1
  • Each process requests one resource at a time.
  • As each process has its turn executing, each
    process requests one resource.
  • By the time each process has had a turn at
    executing, each process holds one resource.
  • This still leaves one resource free for one
    process to use to let it execute to completion.
  • This first process now releases its resources to
    be used by the other two processes.

13
Bill STILL Sucks!
  • Scenario 2
  • Each process requests two resources at a time.
  • As each process has its turn executing, each
    process requests two resources.
  • Only the first two processes can execute to
    completion, as they hold all four resources.
  • When either of the first two processes completes
    they will release their two resources, thus
    allowing the third process to execute.

14
QUESTION 4
  • If the probability of deadlock is low timeouts
    appear to be a suitable method for resolving a
    deadlock in a centralized or distributed system.
  • What problems do you see for this approach?

15
Timeouts for Deadlock
  • How long do we set the timeouts?
  • Too short System will time out even though a
    state of circular wait doesnt exist yet.
  • Too long Waste of system time, power, and
    resources.
  • What to do when a timeout occurs?
  • If we kill all processes involved, they may reach
    deadlock in the same way again.

16
Need help? Ask me! )
  • Daniel COMARMOND
  • E-Mail dacomarm_at_it.uts.edu.au
  • ICQ 6606132
  • Phone 0421-036-986
  • Website http//charlie.it.uts.edu.au/dacomarm
  • THE SECRET WORD
  • Username www
  • Password rosebud
Write a Comment
User Comments (0)
About PowerShow.com