Resource types R 1 1, R 2 2,..., R m CPU cycles, memory space, files, I/O devices Each resource type R i has W i instances.

Relaterede dokumenter
PARALLELIZATION OF ATTILA SIMULATOR WITH OPENMP MIGUEL ÁNGEL MARTÍNEZ DEL AMOR MINIPROJECT OF TDT24 NTNU

Fejlbeskeder i SMDB. Business Rules Fejlbesked Kommentar. Validate Business Rules. Request- ValidateRequestRegist ration (Rules :1)

Linear Programming ١ C H A P T E R 2

Business Rules Fejlbesked Kommentar

Fejlbeskeder i Stofmisbrugsdatabasen (SMDB)

Project Step 7. Behavioral modeling of a dual ported register set. 1/8/ L11 Project Step 5 Copyright Joanne DeGroat, ECE, OSU 1

Privat-, statslig- eller regional institution m.v. Andet Added Bekaempelsesudfoerende: string No Label: Bekæmpelsesudførende

Karaktergivende opgave i Styresystemer og multiprogrammering (reeksamen) 13. august 2007

Skriftlig Eksamen Kombinatorik, Sandsynlighed og Randomiserede Algoritmer (DM528)

Basic statistics for experimental medical researchers

IBM Network Station Manager. esuite 1.5 / NSM Integration. IBM Network Computer Division. tdc - 02/08/99 lotusnsm.prz Page 1

User Manual for LTC IGNOU

Vina Nguyen HSSP July 13, 2008

Uniprocessor Scheduling

Portal Registration. Check Junk Mail for activation . 1 Click the hyperlink to take you back to the portal to confirm your registration

extreme Programming Kunders og udvikleres menneskerettigheder

On the complexity of drawing trees nicely: corrigendum

Unitel EDI MT940 June Based on: SWIFT Standards - Category 9 MT940 Customer Statement Message (January 2004)

Vores mange brugere på musskema.dk er rigtig gode til at komme med kvalificerede ønsker og behov.

Aktivering af Survey funktionalitet

University of Copenhagen Faculty of Science Written Exam - 3. April Algebra 3

Skriftlig Eksamen Beregnelighed (DM517)

Brug sømbrættet til at lave sjove figurer. Lav fx: Få de andre til at gætte, hvad du har lavet. Use the nail board to make funny shapes.

Handling Sporadic Tasks in Off- Line Scheduled Distributed Real Time Systems

PMDK PC-Side Basic Function Reference (Version 1.0)

Status på det trådløse netværk

Sign variation, the Grassmannian, and total positivity

DET KONGELIGE BIBLIOTEK NATIONALBIBLIOTEK OG KØBENHAVNS UNIVERSITETS- BIBLIOTEK. Index

Deadlocks dopsys 1 onsdag den 8. december 2010

Trolling Master Bornholm 2016 Nyhedsbrev nr. 3

Special VFR. - ved flyvning til mindre flyveplads uden tårnkontrol som ligger indenfor en kontrolzone

Engelsk. Niveau D. De Merkantile Erhvervsuddannelser September Casebaseret eksamen. og

Satisability of Boolean Formulas

RoE timestamp and presentation time in past

Black Jack --- Review. Spring 2012

Besvarelser til Lineær Algebra Reeksamen Februar 2017

Help / Hjælp

ArbejsskadeAnmeldelse

Side 1 af 9. SEPA Direct Debit Betalingsaftaler Vejledning

Skriftlig Eksamen Beregnelighed (DM517)

Sikkerhedsvejledning

VEDLIGEHOLDELSE AF SENGE

UNISONIC TECHNOLOGIES CO.,

NOTIFICATION. - An expression of care

WIFI koder til Miljøagenturet: Brugernavn: AIACE course Kodeord: TsEG2pVL EU LOGIN KURSUS 21. AUGUST FORMIDDAG:

An expression of care Notification. Engelsk

TM4 Central Station. User Manual / brugervejledning K2070-EU. Tel Fax

ECE 551: Digital System * Design & Synthesis Lecture Set 5

Financial Literacy among 5-7 years old children

Shooting tethered med Canon EOS-D i Capture One Pro. Shooting tethered i Capture One Pro 6.4 & 7.0 på MAC OS-X & 10.8

Small Autonomous Devices in civil Engineering. Uses and requirements. By Peter H. Møller Rambøll

Nyhedsmail, december 2013 (scroll down for English version)

ATEX direktivet. Vedligeholdelse af ATEX certifikater mv. Steen Christensen

Skriftlig Eksamen Diskret matematik med anvendelser (DM72)

Strategic Capital ApS has requested Danionics A/S to make the following announcement prior to the annual general meeting on 23 April 2013:

Masters Thesis - registration form Kandidatafhandling registreringsformular

Web-seminar. 30 March Noter

Exercise 6.14 Linearly independent vectors are also affinely independent.

South Baileygate Retail Park Pontefract

Opera Ins. Model: MI5722 Product Name: Pure Sine Wave Inverter 1000W 12VDC/230 30A Solar Regulator

VEDLIGEHOLDELSE AF MALEDE MØBLER

Subject to terms and conditions. WEEK Type Price EUR WEEK Type Price EUR WEEK Type Price EUR WEEK Type Price EUR

SEPA Direct Debit. Mandat Vejledning Nets Lautrupbjerg 10 DK-2750 Ballerup

Generalized Probit Model in Design of Dose Finding Experiments. Yuehui Wu Valerii V. Fedorov RSU, GlaxoSmithKline, US

Engelsk. Niveau C. De Merkantile Erhvervsuddannelser September Casebaseret eksamen. og

OXFORD. Botley Road. Key Details: Oxford has an extensive primary catchment of 494,000 people

Skriftlig Eksamen Automatteori og Beregnelighed (DM17)

Forslag til implementering af ResearcherID og ORCID på SCIENCE

ANNONCERING AF CYKELTAXAHOLDEPLADSER I RØD ZONE OG LANGELINIE

ROTERENDE TABURET 360 GRADER MED HYL Brugsanvisning. ROTATING SHOWER STOOL WITH TRAY Installation Manual. Size: 148 x 210 mm 105g copper paper

Titel: Barry s Bespoke Bakery

Trolling Master Bornholm 2016 Nyhedsbrev nr. 5

Hvor er mine runde hjørner?

Userguide. NN Markedsdata. for. Microsoft Dynamics CRM v. 1.0

Large Scale Sequencing By Hybridization. Tel Aviv University

how to save excel as pdf

FAST FORRETNINGSSTED FAST FORRETNINGSSTED I DANSK PRAKSIS

Remember the Ship, Additional Work

Bilag. Resume. Side 1 af 12

Trolling Master Bornholm 2016 Nyhedsbrev nr. 6

Kurver og flader Aktivitet 15 Geodætiske kurver, Isometri, Mainardi-Codazzi, Teorema Egregium

The X Factor. Målgruppe. Læringsmål. Introduktion til læreren klasse & ungdomsuddannelser Engelskundervisningen

CS 4390/5387 SOFTWARE V&V LECTURE 8 SYSTEM TESTING. Performed after the software has been assembled. But must be planned before

JOHN LENNON (DANISH EDITION) BY CYNTHIA LENNON

Bookingmuligheder for professionelle brugere i Dansehallerne

Trolling Master Bornholm 2014

applies equally to HRT and tibolone this should be made clear by replacing HRT with HRT or tibolone in the tibolone SmPC.

Design by Contract. Design and Programming by Contract. Oversigt. Prædikater

Timetable will be aviable after sep. 5. when the sing up ends. Provicius timetable on the next sites.

Personspecifikke identifikationsnumre (PID)

DANSK INSTALLATIONSVEJLEDNING VLMT500 ADVARSEL!

Mandara. PebbleCreek. Tradition Series. 1,884 sq. ft robson.com. Exterior Design A. Exterior Design B.

Sortering fra A-Z. Henrik Dorf Chefkonsulent SAS Institute

Den nye Eurocode EC Geotenikerdagen Morten S. Rasmussen

MEDLEY CHALLENGE 2016/2017

Ventilation. Du skal selv være med til at holde din lejlighed sund You are responsible too: keep your apartment healthy

Trolling Master Bornholm 2016 Nyhedsbrev nr. 7

E K S T R A O R D I N Æ R G E N E R A F O R S A M L I N G E X T R A O R D I N A R Y G E N E R A L M E E T I N G. Azanta A/S. J.nr.

Det er muligt at chekce følgende opg. i CodeJudge: og

E-PAD Bluetooth hængelås E-PAD Bluetooth padlock E-PAD Bluetooth Vorhängeschloss

Transkript:

System Model Resource types R 1 1, R 2 2,..., R m CPU cycles, memory space, files, I/O devices Each resource type R i has W i instances. Each process utilizes a resource as follows: request use e.g., request device, open file, allocate memory release e.g., release device, close file, free memory This sequence should always be followed. 7.7 Silberschatz, Galvin and Gagne 2009

Deadlock Characterization Deadlock can arise if four conditions hold simultaneously. Necessary conditions for Deadlock are followings. Mutual exclusion: only one process at a time can use a resource. Hold and wait: a process holding at least one resource is waiting to acquire additional resources held by other processes. No preemption: a resource can be released only voluntarily by a process that is holding it, after the process has completed its task. Circular wait: there exists a set {P 0, P 1,, P n } of waiting processes such that P 0 is waiting for a resource that is held by P 1, P 1 is waiting for a resource that t is held by P 2, P n 1 is waiting for a resource that is held by P n, and P n is waiting for a resource that is held by P 0. 7.8 Silberschatz, Galvin and Gagne 2009

Deadlock Characterization This is a Necessary Condition e.g., not all accesses of mutual exclusion result in deadlock, but in case of deadlock, mutual exclusion happens. e.g., not all circular wait results in deadlock, but in case of deadlock, circular wait happens. However, when deadlock happens, these four conditions are satisfied simultaneously. 7.9 Silberschatz, Galvin and Gagne 2009

Resource-Allocation Graph A set of vertices V and a set of edges E. V is partitioned into two types: P = {P 1, P 2,, P n }, the set consisting of all the processes in the system. R = {R 1 1, R 2 2,, R m m}, the set consisting of all resources types in the system. t d di t d d P R request edge directed edge P i R j assignment edge directed edge R j P i 7.10 Silberschatz, Galvin and Gagne 2009

Resource-Allocation Graph (Cont.) Process Resource Type with 4 instances P i requests instance of R j P i Request edge P i is holding an instance of R j R j P i Assignment edge R j 7.11 Silberschatz, Galvin and Gagne 2009

Example of a Resource Allocation Graph 7.12 Silberschatz, Galvin and Gagne 2009

Resource Allocation Graph With A Deadlock 2 cycles 7.13 Silberschatz, Galvin and Gagne 2009

Resource Allocation Graph With A Cycle But No Deadlock Observations After P4 release the resource R2, P3 can obtain resource R2. : No cycles No deadlock : Cycles may have deadlock i.e., Cycle in graph is necessary condition, not sufficient condition, for deadlock. 7.14 Silberschatz, Galvin and Gagne 2009

Basic Facts If graph contains no cycles no deadlock. If graph contains a cycle if only one instance per resource type, then deadlock. if several instances per resource type, the possibility of deadlock. 7.15 Silberschatz, Galvin and Gagne 2009

Methods for Handling Deadlocks Ensure that the system will never enter a deadlock state. Allow the system to enter a deadlock state and then recover. Ignore the deadlock and pretend that deadlocks never occur in the system; used by most operating systems, including UNIX. It is then up to the application developer to write the program that handle deadlocks. 7.16 Silberschatz, Galvin and Gagne 2009

Methods for Handling Deadlocks Deadlock Prevention Deadlock Avoidance Deadlock Detection and Recovery 7.17 Silberschatz, Galvin and Gagne 2009

Deadlock Prevention Ensure that at lease one of the necessary conditions is false at all time. Mutual Exclusion This condition is inherently not allowed for nonsharable resources Mutual exclusion must hold at all times e.g., printer can not be simultaneously shared by several processes. i.e., must always hold this condition in case of nonsharable resources. cf. sharable resource all requestor can share (request) so no deadlock at all. 7.18 Silberschatz, Galvin and Gagne 2009

Deadlock Prevention Ensure that at lease one of the necessary conditions is false at all time. Hold and Wait must guarantee that whenever a process requests a resource, it does not hold any other resources. Method 1 Only before execution, process can request and be allocated its resources in one shot method execution (only before starting) i.e., after all resources are obtained, the process can execute its very first start. Method 2 Method 1 is too much inefficient because of before execution Allow process to request resources only when the process has no resource at all (even in the middle of executing). Problems Low resource utilization Starvation possible. 7.19 Silberschatz, Galvin and Gagne 2009

Deadlock Prevention (Cont.) Ensure that at lease one of the necessary conditions is false at all time. No Preemption If a process, that is holding some resources, requests another resource that cannot be immediately allocated to it, then all currently allocated resources are released. That is, preempted. Preempted resources are added to the list of resources for which the process is waiting. Process will be restarted only when it can regain its old resources, as well as the new ones that it is requesting. i.e., re-request all its resources again and re-start. 7.20 Silberschatz, Galvin and Gagne 2009

Deadlock Prevention (Cont.) Ensure that at lease one of the necessary conditions is false at all time. Circular Wait impose a total ordering into all resource types, and each process requests its resources in an increasing order of enumeration. Impose the sequence of resource request e.g., F(card drive) = 1, F(disk drive) = 5, F(tape drive) = 7, F(printer drive) = 12 If Ri can be requested, then new resource Rj can only be requested F(Rj) > F(Ri). Proof by contradiction In this total ordering, there is no circular wait. But let s assume that there exists circular wait. Then, F(r0) < F(r1)< < F(rn) < F(r0). But F(r0) < F(r0) is wrong because of wrong assumption. So there is no circular wait. 7.21 Silberschatz, Galvin and Gagne 2009

Deadlock Prevention (Cont.) Ensure that at lease one of the necessary conditions is false at all time. E.g., dining philosophers problem Hold and wait : picking up chopsticks only if both chopsticks are available No Preemption : if other chopstick is not available, release chopsticks. Circular wait : chopstick ordering 1 to 5, with requesting 1-2, 2-3, 3-4, 4-5, 1-5 7.22 Silberschatz, Galvin and Gagne 2009

Deadlock Avoidance Deadlock Prevention is implemented by imposing Restriction on Resource Request. Although cycle exists, no deadlock is possible. Therefore, low device utilization and low system throughput. Possibility of starvation ti Deadlock Avoidance requires that the system has some additional priori information With the knowledge of the complete sequence of requests and releases for each process, system can avoid a possible future deadlock Deadlock avoidance allows deadlock necessary conditions but it avoid properly. Thus avoidance allows better resource utilization than prevention. 7.23 Silberschatz, Galvin and Gagne 2009