Deadlocks

{"title":"Deadlocks","authors":"","doi":"10.3139/9783446467118.037","DOIUrl":null,"url":null,"abstract":"Deadlock-prevention algorithms, as discussed in Section 7.4, prevent deadlocks by restraining how requests can be made. The restraints ensure that at least one of the necessary conditions for deadlock cannot occur and, hence, that deadlocks cannot hold. Possible side effects of preventing deadlocks by this method, however, are low device utilization and reduced system throughput. An alternative method for avoiding deadlocks is to require additional information about how resources are to be requested. For example, in a system with one tape drive and one printer, the system might need to know that process P will request first the tape drive and then the printer before releasing both resources, whereas process Q will request first the printer and then the tape drive. With this knowledge of the complete sequence of requests and releases for each process, the system can decide for each request whether or not the process should wait in order to avoid a possible future deadlock. Each request requires that in making this decision the system consider the resources currently available, the resources currently allocated to each process, and the future requests and releases of each process. The various algorithms that use this approach differ in the amount and type of information required. The simplest and most useful model requires that each process declare the maximum number of resources of each type that it may need. Given this a priori information, it is possible to construct an algorithm that ensures that the system will never enter a deadlocked state. Such an algorithm defines the deadlock-avoidance approach. A deadlock-avoidance algorithm dynamically examines the resource-allocation state to ensure that a circular-wait condition can never exist. The resource-allocation state is defined by the number of available and allocated resources and the maximum demands of the processes. In the following sections, we explore two deadlock-avoidance algorithms. A state is safe if the system can allocate resources to each process (up to its maximum) in some order and still avoid a deadlock. More formally, a system is in a safe state only if there exists a safe sequence. A sequence of processes is a safe sequence for the current allocation state if, for each , the resource requests that can still make can be satisfied by the currently available resources plus the resources held by all , with. In this situation, if the resources that needs are not immediately available, then can wait until …","PeriodicalId":234422,"journal":{"name":"Programmieren lernen mit Kotlin","volume":"05 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2020-09-07","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Programmieren lernen mit Kotlin","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.3139/9783446467118.037","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

Deadlock-prevention algorithms, as discussed in Section 7.4, prevent deadlocks by restraining how requests can be made. The restraints ensure that at least one of the necessary conditions for deadlock cannot occur and, hence, that deadlocks cannot hold. Possible side effects of preventing deadlocks by this method, however, are low device utilization and reduced system throughput. An alternative method for avoiding deadlocks is to require additional information about how resources are to be requested. For example, in a system with one tape drive and one printer, the system might need to know that process P will request first the tape drive and then the printer before releasing both resources, whereas process Q will request first the printer and then the tape drive. With this knowledge of the complete sequence of requests and releases for each process, the system can decide for each request whether or not the process should wait in order to avoid a possible future deadlock. Each request requires that in making this decision the system consider the resources currently available, the resources currently allocated to each process, and the future requests and releases of each process. The various algorithms that use this approach differ in the amount and type of information required. The simplest and most useful model requires that each process declare the maximum number of resources of each type that it may need. Given this a priori information, it is possible to construct an algorithm that ensures that the system will never enter a deadlocked state. Such an algorithm defines the deadlock-avoidance approach. A deadlock-avoidance algorithm dynamically examines the resource-allocation state to ensure that a circular-wait condition can never exist. The resource-allocation state is defined by the number of available and allocated resources and the maximum demands of the processes. In the following sections, we explore two deadlock-avoidance algorithms. A state is safe if the system can allocate resources to each process (up to its maximum) in some order and still avoid a deadlock. More formally, a system is in a safe state only if there exists a safe sequence. A sequence of processes is a safe sequence for the current allocation state if, for each , the resource requests that can still make can be satisfied by the currently available resources plus the resources held by all , with. In this situation, if the resources that needs are not immediately available, then can wait until …
死锁
死锁预防算法,如7.4节所讨论的,通过限制如何发出请求来防止死锁。约束确保至少不会发生死锁的一个必要条件,因此死锁无法保持。然而,通过这种方法防止死锁的可能副作用是降低设备利用率和降低系统吞吐量。避免死锁的另一种方法是要求有关如何请求资源的附加信息。例如,在一个有一台磁带机和一台打印机的系统中,系统可能需要知道进程P在释放这两个资源之前首先请求磁带机,然后是打印机,而进程Q首先请求打印机,然后是磁带机。了解了每个进程的请求和释放的完整序列后,系统就可以为每个请求决定进程是否应该等待,以避免可能的死锁。每个请求都要求系统在做出决策时考虑当前可用的资源、当前分配给每个进程的资源以及每个进程未来的请求和释放。使用这种方法的各种算法在所需信息的数量和类型上有所不同。最简单和最有用的模型要求每个进程声明它可能需要的每种类型的最大资源数量。有了这些先验信息,就有可能构造一个算法来确保系统永远不会进入死锁状态。这种算法定义了避免死锁的方法。死锁避免算法动态检查资源分配状态,以确保循环等待条件永远不会存在。资源分配状态由可用资源和已分配资源的数量以及进程的最大需求来定义。在接下来的章节中,我们将探讨两种避免死锁的算法。如果系统能够以某种顺序为每个进程分配资源(最多分配到它的最大值),并且仍然避免死锁,那么这种状态就是安全的。更正式地说,只有存在安全序列时,系统才处于安全状态。进程序列是当前分配状态的安全序列,如果对于每个进程,仍然可以发出的资源请求可以由当前可用资源加上所有进程持有的资源来满足。在这种情况下,如果需要的资源不能立即获得,那么可以等到……
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信